Skip to content

Commit 36bcab2

Browse files
committed
RPC/Wallet: Add RBF support for fundrawtransaction
1 parent 891c5ee commit 36bcab2

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/wallet/rpcwallet.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2629,7 +2629,7 @@ UniValue fundrawtransaction(const JSONRPCRequest& request)
26292629
return NullUniValue;
26302630
}
26312631

2632-
if (request.fHelp || request.params.size() < 1 || request.params.size() > 2)
2632+
if (request.fHelp || request.params.size() < 1 || request.params.size() > 3)
26332633
throw std::runtime_error(
26342634
"fundrawtransaction \"hexstring\" ( options )\n"
26352635
"\nAdd inputs to a transaction until it has enough in value to meet its out value.\n"
@@ -2658,6 +2658,7 @@ UniValue fundrawtransaction(const JSONRPCRequest& request)
26582658
" Those recipients will receive less bitcoins than you enter in their corresponding amount field.\n"
26592659
" If no outputs are specified here, the sender pays the fee.\n"
26602660
" [vout_index,...]\n"
2661+
" \"optIntoRbf\" (boolean, optional) Allow this transaction to be replaced by a transaction with higher fees\n"
26612662
" }\n"
26622663
" for backward compatibility: passing in a true instead of an object will result in {\"includeWatching\":true}\n"
26632664
"\nResult:\n"
@@ -2709,6 +2710,7 @@ UniValue fundrawtransaction(const JSONRPCRequest& request)
27092710
{"reserveChangeKey", UniValueType(UniValue::VBOOL)},
27102711
{"feeRate", UniValueType()}, // will be checked below
27112712
{"subtractFeeFromOutputs", UniValueType(UniValue::VARR)},
2713+
{"optIntoRbf", UniValueType(UniValue::VBOOL)},
27122714
},
27132715
true, true);
27142716

@@ -2741,6 +2743,10 @@ UniValue fundrawtransaction(const JSONRPCRequest& request)
27412743

27422744
if (options.exists("subtractFeeFromOutputs"))
27432745
subtractFeeFromOutputs = options["subtractFeeFromOutputs"].get_array();
2746+
2747+
if (options.exists("optIntoRbf")) {
2748+
coinControl.signalRbf = options["optIntoRbf"].get_bool();
2749+
}
27442750
}
27452751
}
27462752

0 commit comments

Comments
 (0)