diff options
author | Andrew Chow <github@achow101.com> | 2023-03-22 12:47:18 -0400 |
---|---|---|
committer | Andrew Chow <github@achow101.com> | 2023-03-22 12:54:26 -0400 |
commit | fc7c21f664fd24ac17f518d07f04e0a3d9f8681c (patch) | |
tree | 2f07f65b450357c5ab4a512bd1f7a8d2f0d26aae /test | |
parent | a70911492fcd1f726782cca2f1ffac18c25e8fb4 (diff) | |
parent | d7cc503843769b789dc5f031b4ddc75d555ba980 (diff) | |
download | bitcoin-fc7c21f664fd24ac17f518d07f04e0a3d9f8681c.tar.xz |
Merge bitcoin/bitcoin#27271: RPC: Fix fund transaction crash when at 0-value, 0-fee
d7cc503843769b789dc5f031b4ddc75d555ba980 Fix fund transaction case at 0-value, 0-fee (Greg Sanders)
Pull request description:
and when no inputs are pre-selected.
triggered via:
walletcreatefundedpsbt '[]' '[{"data": "deadbeef"}]' 0 '{"fee_rate": "0"}'
ACKs for top commit:
achow101:
ACK d7cc503843769b789dc5f031b4ddc75d555ba980
josibake:
ACK https://github.com/bitcoin/bitcoin/pull/27271/commits/d7cc503843769b789dc5f031b4ddc75d555ba980
furszy:
Crashes sucks code ACK d7cc5038
Tree-SHA512: 3f5e10875666aaf52c11d6a38b951aa75d0cbe684cc7f904e199f7a864923bf31d03a654687f8b746cae0eebb886a799bff2c6d200699438480d4c0ff8785f3a
Diffstat (limited to 'test')
-rwxr-xr-x | test/functional/rpc_psbt.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/test/functional/rpc_psbt.py b/test/functional/rpc_psbt.py index 76886cc0ea..0fc0c0df8b 100755 --- a/test/functional/rpc_psbt.py +++ b/test/functional/rpc_psbt.py @@ -941,6 +941,9 @@ class PSBTTest(BitcoinTestFramework): assert_equal(self.nodes[0].finalizepsbt(psbt.to_base64()), {'hex': '0200000001dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd0000000000000000000100000000000000000000000000', 'complete': True}) + self.log.info("Test we don't crash when making a 0-value funded transaction at 0 fee without forcing an input selection") + assert_raises_rpc_error(-4, "Transaction requires one destination of non-0 value, a non-0 feerate, or a pre-selected input", self.nodes[0].walletcreatefundedpsbt, [], [{"data": "deadbeef"}], 0, {"fee_rate": "0"}) + if __name__ == '__main__': PSBTTest().main() |