Browse Source

RPC/Wallet: Add RBF support for fundrawtransaction

0.15
Luke Dashjr 8 years ago
parent
commit
36bcab2356
  1. 8
      src/wallet/rpcwallet.cpp

8
src/wallet/rpcwallet.cpp

@ -2629,7 +2629,7 @@ UniValue fundrawtransaction(const JSONRPCRequest& request)
return NullUniValue; 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( throw std::runtime_error(
"fundrawtransaction \"hexstring\" ( options )\n" "fundrawtransaction \"hexstring\" ( options )\n"
"\nAdd inputs to a transaction until it has enough in value to meet its out value.\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" " 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" " If no outputs are specified here, the sender pays the fee.\n"
" [vout_index,...]\n" " [vout_index,...]\n"
" \"optIntoRbf\" (boolean, optional) Allow this transaction to be replaced by a transaction with higher fees\n"
" }\n" " }\n"
" for backward compatibility: passing in a true instead of an object will result in {\"includeWatching\":true}\n" " for backward compatibility: passing in a true instead of an object will result in {\"includeWatching\":true}\n"
"\nResult:\n" "\nResult:\n"
@ -2709,6 +2710,7 @@ UniValue fundrawtransaction(const JSONRPCRequest& request)
{"reserveChangeKey", UniValueType(UniValue::VBOOL)}, {"reserveChangeKey", UniValueType(UniValue::VBOOL)},
{"feeRate", UniValueType()}, // will be checked below {"feeRate", UniValueType()}, // will be checked below
{"subtractFeeFromOutputs", UniValueType(UniValue::VARR)}, {"subtractFeeFromOutputs", UniValueType(UniValue::VARR)},
{"optIntoRbf", UniValueType(UniValue::VBOOL)},
}, },
true, true); true, true);
@ -2741,6 +2743,10 @@ UniValue fundrawtransaction(const JSONRPCRequest& request)
if (options.exists("subtractFeeFromOutputs")) if (options.exists("subtractFeeFromOutputs"))
subtractFeeFromOutputs = options["subtractFeeFromOutputs"].get_array(); subtractFeeFromOutputs = options["subtractFeeFromOutputs"].get_array();
if (options.exists("optIntoRbf")) {
coinControl.signalRbf = options["optIntoRbf"].get_bool();
}
} }
} }

Loading…
Cancel
Save