Skip to content

Commit 0fc1c68

Browse files
committed
[rpc] send: fix parsing replaceable option
1 parent efc9b85 commit 0fc1c68

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

src/wallet/rpcwallet.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3995,7 +3995,7 @@ static RPCHelpMan send()
39953995
int change_position;
39963996
bool rbf = pwallet->m_signal_rbf;
39973997
if (options.exists("replaceable")) {
3998-
rbf = options["add_to_wallet"].get_bool();
3998+
rbf = options["replaceable"].get_bool();
39993999
}
40004000
CMutableTransaction rawTx = ConstructTransaction(options["inputs"], request.params[0], options["locktime"], rbf);
40014001
CCoinControl coin_control;

test/functional/wallet_send.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -328,8 +328,12 @@ def run_test(self):
328328
self.test_send(from_wallet=w0, to_wallet=w1, amount=1, inputs=[utxo1],add_to_wallet=False)
329329

330330
self.log.info("Replaceable...")
331-
self.test_send(from_wallet=w0, to_wallet=w1, amount=1, add_to_wallet=False, replaceable=True)
332-
self.test_send(from_wallet=w0, to_wallet=w1, amount=1, add_to_wallet=False, replaceable=False)
331+
res = self.test_send(from_wallet=w0, to_wallet=w1, amount=1, add_to_wallet=True, replaceable=True)
332+
assert res["complete"]
333+
assert_equal(self.nodes[0].gettransaction(res["txid"])["bip125-replaceable"], "yes")
334+
res = self.test_send(from_wallet=w0, to_wallet=w1, amount=1, add_to_wallet=True, replaceable=False)
335+
assert res["complete"]
336+
assert_equal(self.nodes[0].gettransaction(res["txid"])["bip125-replaceable"], "no")
333337

334338
self.log.info("Subtract fee from output")
335339
self.test_send(from_wallet=w0, to_wallet=w1, amount=1, subtract_fee_from_outputs=[0])

0 commit comments

Comments
 (0)