|
|
@ -24,7 +24,7 @@ echo 'Balance: '$balance |
|
|
|
if (( $(echo "$balance < 11" | bc -l) )); then |
|
|
|
echo "----------------------------------------------------------------" |
|
|
|
echo " " |
|
|
|
# exit |
|
|
|
exit |
|
|
|
fi |
|
|
|
|
|
|
|
# Set the send to address, and send all coinbase transactions |
|
|
@ -36,10 +36,9 @@ hex=$(curl -s --user $curluser:$curlpass --data-binary "@$curdir/createrawtx.cur |
|
|
|
nlocktime=$(printf "%08x" $(date +%s) | dd conv=swab 2> /dev/null | rev) |
|
|
|
hex=${hex::-8}$nlocktime |
|
|
|
signed=$(curl -s --user $curluser:$curlpass --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "signrawtransaction", "params": ["'$hex'"]}' -H 'content-type: text/plain;' http://127.0.0.1:$curlport/ | jq -r .result.hex) |
|
|
|
echo $signed |
|
|
|
|
|
|
|
#Broadcast the transaction |
|
|
|
#txid=$(curl -s --user $curluser:$curlpass --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "sendrawtransaction", "params": ["'$signed'"]}' -H 'content-type: text/plain;' http://127.0.0.1:$curlport/ | jq -r .result) |
|
|
|
#echo $txid |
|
|
|
txid=$(curl -s --user $curluser:$curlpass --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "sendrawtransaction", "params": ["'$signed'"]}' -H 'content-type: text/plain;' http://127.0.0.1:$curlport/ | jq -r .result) |
|
|
|
echo $txid |
|
|
|
echo "----------------------------------------------------------------" |
|
|
|
echo " " |
|
|
|