From e3b750da4e6d95c173bfa07d0bd11c77ad56cc74 Mon Sep 17 00:00:00 2001 From: Gregory Sanders Date: Fri, 30 Aug 2019 11:35:43 -0400 Subject: [PATCH 1/2] Fix sendtomainchain with pak when subtracting fee from output --- src/wallet/rpcwallet.cpp | 2 +- test/functional/feature_pak.py | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp index 027d702305..c07b5930a5 100644 --- a/src/wallet/rpcwallet.cpp +++ b/src/wallet/rpcwallet.cpp @@ -5190,7 +5190,7 @@ UniValue sendtomainchain_pak(const JSONRPCRequest& request) bool subtract_fee = false; if (request.params.size() > 2) { - subtract_fee = request.params[1].get_bool(); + subtract_fee = request.params[2].get_bool(); } CPAKList paklist = g_paklist_blockchain; diff --git a/test/functional/feature_pak.py b/test/functional/feature_pak.py index be1d1b8da8..0c5bed9b8b 100755 --- a/test/functional/feature_pak.py +++ b/test/functional/feature_pak.py @@ -410,6 +410,10 @@ def compare(actual, expected): raise Exception("Found unexpected peg-out output") assert(peg_out_found) + # Test that subtracting fee from output works + self.nodes[i_pak1].sendtomainchain("", self.nodes[i_pak1].getbalance()["bitcoin"], True) + assert_equal(self.nodes[i_pak1].getbalance()["bitcoin"], 0) + # TODO: create rawsendtomainchain to do transaction surgery for testing if __name__ == '__main__': From 299c3fc9f51d5e8238f123ba8a9d612785ca110e Mon Sep 17 00:00:00 2001 From: Gregory Sanders Date: Fri, 30 Aug 2019 11:36:01 -0400 Subject: [PATCH 2/2] fix HelpExamplRPC port for liquidv1 vs bitcoin mainnet --- src/rpc/server.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rpc/server.cpp b/src/rpc/server.cpp index 0d73a57d52..6526fe42da 100644 --- a/src/rpc/server.cpp +++ b/src/rpc/server.cpp @@ -590,7 +590,7 @@ std::string HelpExampleCli(const std::string& methodname, const std::string& arg std::string HelpExampleRpc(const std::string& methodname, const std::string& args) { return "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", " - "\"method\": \"" + methodname + "\", \"params\": [" + args + "] }' -H 'content-type: text/plain;' http://127.0.0.1:8332/\n"; + "\"method\": \"" + methodname + "\", \"params\": [" + args + "] }' -H 'content-type: text/plain;' http://127.0.0.1:7041/\n"; } void RPCSetTimerInterfaceIfUnset(RPCTimerInterface *iface)