forked from BitcoinMechanic/bitcoind-startos
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add prioritise transaction action (#8)
* add prioritise transaction action * actions fully works * make them strings for now * ok it's a number now * allow larger range
- Loading branch information
1 parent
b4099bf
commit 18d1303
Showing
3 changed files
with
65 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/bin/sh | ||
|
||
set -e | ||
|
||
cat > input.json | ||
TXID=$(jq -r '.["txid"]' input.json) | ||
PRIORITY_DELTA=$(jq -r '.["priority-delta"]' input.json) | ||
if [ $PRIORITY_DELTA = "null" ]; then | ||
PRIORITY_DELTA="0" | ||
fi | ||
FEE_DELTA=$(jq -r '.["fee-delta"]' input.json) | ||
if [ $FEE_DELTA = "null" ]; then | ||
FEE_DELTA="0" | ||
fi | ||
rm input.json | ||
result=" { | ||
\"version\": \"0\", | ||
\"message\": \"Transaction prioritised with priority delta $PRIORITY_DELTA and fee delta $FEE_DELTA\", | ||
\"value\": null, | ||
\"copyable\": false, | ||
\"qr\": false | ||
}" | ||
>&2 bitcoin-cli prioritisetransaction $TXID $PRIORITY_DELTA $FEE_DELTA && echo $result |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters