Skip to content

Commit 8f1d783

Browse files
committed
Merge #699: [0.18 backport] sendtomainchain with pak and subtract fee from output fix
299c3fc fix HelpExamplRPC port for liquidv1 vs bitcoin mainnet (Gregory Sanders) e3b750d Fix sendtomainchain with pak when subtracting fee from output (Gregory Sanders) Pull request description: backport of #696 Tree-SHA512: ad2b73f3d384998db2de581299afcfb75e41b5b6a17505cdf2492008671dbd06757a64f1b48fca055ef56128f8069fc5f722ef0341301e621df55a90422568f6
2 parents 01b6302 + 299c3fc commit 8f1d783

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

src/rpc/server.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -590,7 +590,7 @@ std::string HelpExampleCli(const std::string& methodname, const std::string& arg
590590
std::string HelpExampleRpc(const std::string& methodname, const std::string& args)
591591
{
592592
return "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", "
593-
"\"method\": \"" + methodname + "\", \"params\": [" + args + "] }' -H 'content-type: text/plain;' http://127.0.0.1:8332/\n";
593+
"\"method\": \"" + methodname + "\", \"params\": [" + args + "] }' -H 'content-type: text/plain;' http://127.0.0.1:7041/\n";
594594
}
595595

596596
void RPCSetTimerInterfaceIfUnset(RPCTimerInterface *iface)

src/wallet/rpcwallet.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5190,7 +5190,7 @@ UniValue sendtomainchain_pak(const JSONRPCRequest& request)
51905190

51915191
bool subtract_fee = false;
51925192
if (request.params.size() > 2) {
5193-
subtract_fee = request.params[1].get_bool();
5193+
subtract_fee = request.params[2].get_bool();
51945194
}
51955195

51965196
CPAKList paklist = g_paklist_blockchain;

test/functional/feature_pak.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -410,6 +410,10 @@ def compare(actual, expected):
410410
raise Exception("Found unexpected peg-out output")
411411
assert(peg_out_found)
412412

413+
# Test that subtracting fee from output works
414+
self.nodes[i_pak1].sendtomainchain("", self.nodes[i_pak1].getbalance()["bitcoin"], True)
415+
assert_equal(self.nodes[i_pak1].getbalance()["bitcoin"], 0)
416+
413417
# TODO: create rawsendtomainchain to do transaction surgery for testing
414418

415419
if __name__ == '__main__':

0 commit comments

Comments
 (0)