bumpfee first draft

This commit is contained in:
kexkey
2019-08-27 13:36:28 -04:00
committed by kexkey
parent a1195580aa
commit c1d978af9d
7 changed files with 117 additions and 1 deletions

View File

@@ -256,6 +256,14 @@ main()
response_to_client "${response}" ${?}
break
;;
bumpfee)
# POST http://192.168.111.152:8080/bumpfee
# BODY {"txid":"af867c86000da76df7ddb1054b273ca9e034e8c89d049b5b2795f9f590f67648","confTarget":4}
response=$(bumpfee "${line}")
response_to_client "${response}" ${?}
break
;;
addtobatch)
# POST http://192.168.111.152:8080/addtobatch
# BODY {"address":"2N8DcqzfkYi8CkYzvNNS5amoq3SbAcQNXKp","amount":0.00233}

View File

@@ -62,6 +62,32 @@ spend() {
return ${returncode}
}
bumpfee() {
trace "Entering bumpfee()..."
local request=${1}
local txid=$(echo "${request}" | jq ".txid" | tr -d '"')
trace "[bumpfee] txid=${txid}"
local confTarget=$(echo "${request}" | jq ".confTarget")
trace "[bumpfee] confTarget=${confTarget}"
local response
response=$(send_to_spender_node "{\"method\":\"bumpfee\",\"params\":[\"${txid}\",{\"confTarget\":${confTarget}}]}")
local returncode=$?
trace_rc ${returncode}
trace "[bumpfee] response=${response}"
if [ "${returncode}" -eq 0 ]; then
trace "[bumpfee] error!"
else
trace "[bumpfee] success!"
fi
echo "${response}"
return ${returncode}
}
getbalance() {
trace "Entering getbalance()..."