Skip to content

Commit 7a3c997

Browse files
committed
Merge #700: [0.17] sendtomainchain pak fix
ef64be6 fix HelpExamplRPC port for liquidv1 vs bitcoin mainnet (Gregory Sanders) db01a6d Fix sendtomainchain with pak when subtracting fee from output (Gregory Sanders) Pull request description: regression introduced in 0.17 catchup with the convergence of liquid and elements codebases. Tree-SHA512: 6b3c4d2fbb212180818b4dd86eb4a29913ac7d4ea18bb603d851e6a9966480f46539d1ed79b8637a77101cac6fa6e98483c4b0d21dc665c2f8ab3cc6a25b4b04
2 parents da7b8ab + ef64be6 commit 7a3c997

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
@@ -520,7 +520,7 @@ std::string HelpExampleCli(const std::string& methodname, const std::string& arg
520520
std::string HelpExampleRpc(const std::string& methodname, const std::string& args)
521521
{
522522
return "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", "
523-
"\"method\": \"" + methodname + "\", \"params\": [" + args + "] }' -H 'content-type: text/plain;' http://127.0.0.1:8332/\n";
523+
"\"method\": \"" + methodname + "\", \"params\": [" + args + "] }' -H 'content-type: text/plain;' http://127.0.0.1:7041/\n";
524524
}
525525

526526
void RPCSetTimerInterfaceIfUnset(RPCTimerInterface *iface)

src/wallet/rpcwallet.cpp

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

48654865
bool subtract_fee = false;
48664866
if (request.params.size() > 2) {
4867-
subtract_fee = request.params[1].get_bool();
4867+
subtract_fee = request.params[2].get_bool();
48684868
}
48694869

48704870
CPAKList paklist = g_paklist_blockchain;

test/functional/feature_pak.py

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

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

413417
if __name__ == '__main__':

0 commit comments

Comments
 (0)