mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-16 13:01:19 +02:00
Fix sendtomainchain with pak when subtracting fee from output
This commit is contained in:
parent
da7b8abda6
commit
db01a6dc38
2 changed files with 5 additions and 1 deletions
|
|
@ -4864,7 +4864,7 @@ UniValue sendtomainchain_pak(const JSONRPCRequest& request)
|
||||||
|
|
||||||
bool subtract_fee = false;
|
bool subtract_fee = false;
|
||||||
if (request.params.size() > 2) {
|
if (request.params.size() > 2) {
|
||||||
subtract_fee = request.params[1].get_bool();
|
subtract_fee = request.params[2].get_bool();
|
||||||
}
|
}
|
||||||
|
|
||||||
CPAKList paklist = g_paklist_blockchain;
|
CPAKList paklist = g_paklist_blockchain;
|
||||||
|
|
|
||||||
|
|
@ -408,6 +408,10 @@ class PAKTest (BitcoinTestFramework):
|
||||||
raise Exception("Found unexpected peg-out output")
|
raise Exception("Found unexpected peg-out output")
|
||||||
assert(peg_out_found)
|
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
|
# TODO: create rawsendtomainchain to do transaction surgery for testing
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue