mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-13 11:25:02 -05:00
[rpc] send: fix parsing replaceable option
This commit is contained in:
parent
efc9b85e6f
commit
0fc1c685e1
2 changed files with 7 additions and 3 deletions
|
@ -3995,7 +3995,7 @@ static RPCHelpMan send()
|
||||||
int change_position;
|
int change_position;
|
||||||
bool rbf = pwallet->m_signal_rbf;
|
bool rbf = pwallet->m_signal_rbf;
|
||||||
if (options.exists("replaceable")) {
|
if (options.exists("replaceable")) {
|
||||||
rbf = options["add_to_wallet"].get_bool();
|
rbf = options["replaceable"].get_bool();
|
||||||
}
|
}
|
||||||
CMutableTransaction rawTx = ConstructTransaction(options["inputs"], request.params[0], options["locktime"], rbf);
|
CMutableTransaction rawTx = ConstructTransaction(options["inputs"], request.params[0], options["locktime"], rbf);
|
||||||
CCoinControl coin_control;
|
CCoinControl coin_control;
|
||||||
|
|
|
@ -328,8 +328,12 @@ class WalletSendTest(BitcoinTestFramework):
|
||||||
self.test_send(from_wallet=w0, to_wallet=w1, amount=1, inputs=[utxo1],add_to_wallet=False)
|
self.test_send(from_wallet=w0, to_wallet=w1, amount=1, inputs=[utxo1],add_to_wallet=False)
|
||||||
|
|
||||||
self.log.info("Replaceable...")
|
self.log.info("Replaceable...")
|
||||||
self.test_send(from_wallet=w0, to_wallet=w1, amount=1, add_to_wallet=False, replaceable=True)
|
res = self.test_send(from_wallet=w0, to_wallet=w1, amount=1, add_to_wallet=True, replaceable=True)
|
||||||
self.test_send(from_wallet=w0, to_wallet=w1, amount=1, add_to_wallet=False, replaceable=False)
|
assert res["complete"]
|
||||||
|
assert_equal(self.nodes[0].gettransaction(res["txid"])["bip125-replaceable"], "yes")
|
||||||
|
res = self.test_send(from_wallet=w0, to_wallet=w1, amount=1, add_to_wallet=True, replaceable=False)
|
||||||
|
assert res["complete"]
|
||||||
|
assert_equal(self.nodes[0].gettransaction(res["txid"])["bip125-replaceable"], "no")
|
||||||
|
|
||||||
self.log.info("Subtract fee from output")
|
self.log.info("Subtract fee from output")
|
||||||
self.test_send(from_wallet=w0, to_wallet=w1, amount=1, subtract_fee_from_outputs=[0])
|
self.test_send(from_wallet=w0, to_wallet=w1, amount=1, subtract_fee_from_outputs=[0])
|
||||||
|
|
Loading…
Add table
Reference in a new issue