mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-12 21:02:38 -03:00
[rpc] rawtx: Prepare fLimitFree to make it an option
This commit is contained in:
parent
fa28bfa341
commit
fa8b02d36d
1 changed files with 2 additions and 1 deletions
|
@ -866,6 +866,7 @@ UniValue sendrawtransaction(const UniValue& params, bool fHelp)
|
||||||
throw JSONRPCError(RPC_DESERIALIZATION_ERROR, "TX decode failed");
|
throw JSONRPCError(RPC_DESERIALIZATION_ERROR, "TX decode failed");
|
||||||
uint256 hashTx = tx.GetHash();
|
uint256 hashTx = tx.GetHash();
|
||||||
|
|
||||||
|
bool fLimitFree = false;
|
||||||
CAmount nMaxRawTxFee = maxTxFee;
|
CAmount nMaxRawTxFee = maxTxFee;
|
||||||
if (params.size() > 1 && params[1].get_bool())
|
if (params.size() > 1 && params[1].get_bool())
|
||||||
nMaxRawTxFee = 0;
|
nMaxRawTxFee = 0;
|
||||||
|
@ -878,7 +879,7 @@ UniValue sendrawtransaction(const UniValue& params, bool fHelp)
|
||||||
// push to local node and sync with wallets
|
// push to local node and sync with wallets
|
||||||
CValidationState state;
|
CValidationState state;
|
||||||
bool fMissingInputs;
|
bool fMissingInputs;
|
||||||
if (!AcceptToMemoryPool(mempool, state, tx, false, &fMissingInputs, false, nMaxRawTxFee)) {
|
if (!AcceptToMemoryPool(mempool, state, tx, fLimitFree, &fMissingInputs, false, nMaxRawTxFee)) {
|
||||||
if (state.IsInvalid()) {
|
if (state.IsInvalid()) {
|
||||||
throw JSONRPCError(RPC_TRANSACTION_REJECTED, strprintf("%i: %s", state.GetRejectCode(), state.GetRejectReason()));
|
throw JSONRPCError(RPC_TRANSACTION_REJECTED, strprintf("%i: %s", state.GetRejectCode(), state.GetRejectReason()));
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in a new issue