Merge #8287: [wallet] Set fLimitFree = true
fa8b02d [rpc] rawtx: Prepare fLimitFree to make it an option (MarcoFalke) fa28bfa [wallet] Set fLimitFree = true (MarcoFalke)
This commit is contained in:
parent
4fc77cc3a1
commit
0dcca9b99b
@ -887,6 +887,7 @@ UniValue sendrawtransaction(const UniValue& params, bool fHelp)
|
||||
throw JSONRPCError(RPC_DESERIALIZATION_ERROR, "TX decode failed");
|
||||
uint256 hashTx = tx.GetHash();
|
||||
|
||||
bool fLimitFree = false;
|
||||
CAmount nMaxRawTxFee = maxTxFee;
|
||||
if (params.size() > 1 && params[1].get_bool())
|
||||
nMaxRawTxFee = 0;
|
||||
@ -909,7 +910,7 @@ UniValue sendrawtransaction(const UniValue& params, bool fHelp)
|
||||
}
|
||||
CValidationState state;
|
||||
bool fMissingInputs;
|
||||
if (!AcceptToMemoryPool(mempool, state, tx, false, &fMissingInputs, false, nMaxRawTxFee)) {
|
||||
if (!AcceptToMemoryPool(mempool, state, tx, fLimitFree, &fMissingInputs, false, nMaxRawTxFee)) {
|
||||
if (state.IsInvalid()) {
|
||||
throw JSONRPCError(RPC_TRANSACTION_REJECTED, strprintf("%i: %s", state.GetRejectCode(), state.GetRejectReason()));
|
||||
} else {
|
||||
|
@ -1832,7 +1832,7 @@ void CWallet::ReacceptWalletTransactions()
|
||||
CWalletTx& wtx = *(item.second);
|
||||
|
||||
LOCK(mempool.cs);
|
||||
wtx.AcceptToMemoryPool(false, maxTxFee);
|
||||
wtx.AcceptToMemoryPool(maxTxFee);
|
||||
}
|
||||
}
|
||||
|
||||
@ -3646,8 +3646,7 @@ bool CWallet::CommitTransaction(CWalletTx& wtxNew, CReserveKey& reservekey, CCon
|
||||
if (fBroadcastTransactions)
|
||||
{
|
||||
// Broadcast
|
||||
if (!wtxNew.AcceptToMemoryPool(false, maxTxFee))
|
||||
{
|
||||
if (!wtxNew.AcceptToMemoryPool(maxTxFee)) {
|
||||
// This must not fail. The transaction has already been signed and recorded.
|
||||
LogPrintf("CommitTransaction(): Error: Transaction not valid\n");
|
||||
return false;
|
||||
@ -5099,8 +5098,8 @@ int CMerkleTx::GetBlocksToMaturity() const
|
||||
}
|
||||
|
||||
|
||||
bool CMerkleTx::AcceptToMemoryPool(bool fLimitFree, CAmount nAbsurdFee)
|
||||
bool CMerkleTx::AcceptToMemoryPool(const CAmount& nAbsurdFee)
|
||||
{
|
||||
CValidationState state;
|
||||
return ::AcceptToMemoryPool(mempool, state, *this, fLimitFree, NULL, false, nAbsurdFee);
|
||||
return ::AcceptToMemoryPool(mempool, state, *this, true, NULL, false, nAbsurdFee);
|
||||
}
|
||||
|
@ -254,7 +254,7 @@ public:
|
||||
bool IsInMainChain() const { const CBlockIndex *pindexRet; return GetDepthInMainChain(pindexRet) > 0; }
|
||||
int GetBlocksToMaturity() const;
|
||||
/** Pass this transaction to the mempool. Fails if absolute fee exceeds absurd fee. */
|
||||
bool AcceptToMemoryPool(bool fLimitFree, const CAmount nAbsurdFee);
|
||||
bool AcceptToMemoryPool(const CAmount& nAbsurdFee);
|
||||
bool hashUnset() const { return (hashBlock.IsNull() || hashBlock == ABANDON_HASH); }
|
||||
bool isAbandoned() const { return (hashBlock == ABANDON_HASH); }
|
||||
void setAbandoned() { hashBlock = ABANDON_HASH; }
|
||||
|
Loading…
Reference in New Issue
Block a user