RPC/Wallet: Add RBF support for fundrawtransaction

This commit is contained in:
Luke Dashjr 2017-02-02 22:36:50 +00:00
parent 891c5eeec2
commit 36bcab2356

View file

@ -2629,7 +2629,7 @@ UniValue fundrawtransaction(const JSONRPCRequest& request)
return NullUniValue;
}
if (request.fHelp || request.params.size() < 1 || request.params.size() > 2)
if (request.fHelp || request.params.size() < 1 || request.params.size() > 3)
throw std::runtime_error(
"fundrawtransaction \"hexstring\" ( options )\n"
"\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)
" Those recipients will receive less bitcoins than you enter in their corresponding amount field.\n"
" If no outputs are specified here, the sender pays the fee.\n"
" [vout_index,...]\n"
" \"optIntoRbf\" (boolean, optional) Allow this transaction to be replaced by a transaction with higher fees\n"
" }\n"
" for backward compatibility: passing in a true instead of an object will result in {\"includeWatching\":true}\n"
"\nResult:\n"
@ -2709,6 +2710,7 @@ UniValue fundrawtransaction(const JSONRPCRequest& request)
{"reserveChangeKey", UniValueType(UniValue::VBOOL)},
{"feeRate", UniValueType()}, // will be checked below
{"subtractFeeFromOutputs", UniValueType(UniValue::VARR)},
{"optIntoRbf", UniValueType(UniValue::VBOOL)},
},
true, true);
@ -2741,6 +2743,10 @@ UniValue fundrawtransaction(const JSONRPCRequest& request)
if (options.exists("subtractFeeFromOutputs"))
subtractFeeFromOutputs = options["subtractFeeFromOutputs"].get_array();
if (options.exists("optIntoRbf")) {
coinControl.signalRbf = options["optIntoRbf"].get_bool();
}
}
}