Skip to content

Commit

Permalink
Fix sendtomainchain with pak when subtracting fee from output
Browse files Browse the repository at this point in the history
  • Loading branch information
instagibbs committed Aug 30, 2019
1 parent 2857128 commit d35bf08
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/wallet/rpcwallet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5195,7 +5195,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;
Expand Down
4 changes: 4 additions & 0 deletions test/functional/feature_pak.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__':
Expand Down

0 comments on commit d35bf08

Please sign in to comment.