mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-06-29 18:20:58 +02:00
rpc: include_unsafe option for fundrawtransaction
Allow RPC users to opt-in to unsafe inputs when funding a raw transaction. Applications that need to manage a complex RBF flow (such as lightning nodes using anchor outputs) are very limited if they can only use safe inputs. Fixes #21299
This commit is contained in:
@ -394,6 +394,14 @@ class PSBTTest(BitcoinTestFramework):
|
||||
# We don't care about the decode result, but decoding must succeed.
|
||||
self.nodes[0].decodepsbt(double_processed_psbt["psbt"])
|
||||
|
||||
# Make sure unsafe inputs are included if specified
|
||||
self.nodes[2].createwallet(wallet_name="unsafe")
|
||||
wunsafe = self.nodes[2].get_wallet_rpc("unsafe")
|
||||
self.nodes[0].sendtoaddress(wunsafe.getnewaddress(), 2)
|
||||
self.sync_mempools()
|
||||
assert_raises_rpc_error(-4, "Insufficient funds", wunsafe.walletcreatefundedpsbt, [], [{self.nodes[0].getnewaddress(): 1}])
|
||||
wunsafe.walletcreatefundedpsbt([], [{self.nodes[0].getnewaddress(): 1}], 0, {"include_unsafe": True})
|
||||
|
||||
# BIP 174 Test Vectors
|
||||
|
||||
# Check that unknown values are just passed through
|
||||
|
Reference in New Issue
Block a user