Fix sendtomainchain with pak when subtracting fee from output

This commit is contained in:
Gregory Sanders 2019-08-30 11:35:43 -04:00 committed by Steven Roose
parent 1cd81acdd7
commit e3b750da4e
No known key found for this signature in database
GPG key ID: 2F2A88D7F8D68E87
2 changed files with 5 additions and 1 deletions

View file

@ -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;

View file

@ -410,6 +410,10 @@ class PAKTest (BitcoinTestFramework):
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__':