Skip to content

Commit e10af96

Browse files
committed
Merge #8287: [wallet] Set fLimitFree = true
fa8b02d [rpc] rawtx: Prepare fLimitFree to make it an option (MarcoFalke) fa28bfa [wallet] Set fLimitFree = true (MarcoFalke)
2 parents 932d02a + fa8b02d commit e10af96

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

src/rpc/rawtransaction.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -874,6 +874,7 @@ UniValue sendrawtransaction(const UniValue& params, bool fHelp)
874874
throw JSONRPCError(RPC_DESERIALIZATION_ERROR, "TX decode failed");
875875
uint256 hashTx = tx.GetHash();
876876

877+
bool fLimitFree = false;
877878
CAmount nMaxRawTxFee = maxTxFee;
878879
if (params.size() > 1 && params[1].get_bool())
879880
nMaxRawTxFee = 0;
@@ -886,7 +887,7 @@ UniValue sendrawtransaction(const UniValue& params, bool fHelp)
886887
// push to local node and sync with wallets
887888
CValidationState state;
888889
bool fMissingInputs;
889-
if (!AcceptToMemoryPool(mempool, state, tx, false, &fMissingInputs, false, nMaxRawTxFee)) {
890+
if (!AcceptToMemoryPool(mempool, state, tx, fLimitFree, &fMissingInputs, false, nMaxRawTxFee)) {
890891
if (state.IsInvalid()) {
891892
throw JSONRPCError(RPC_TRANSACTION_REJECTED, strprintf("%i: %s", state.GetRejectCode(), state.GetRejectReason()));
892893
} else {

src/wallet/wallet.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1463,7 +1463,7 @@ void CWallet::ReacceptWalletTransactions()
14631463
CWalletTx& wtx = *(item.second);
14641464

14651465
LOCK(mempool.cs);
1466-
wtx.AcceptToMemoryPool(false, maxTxFee);
1466+
wtx.AcceptToMemoryPool(maxTxFee);
14671467
}
14681468
}
14691469

@@ -2502,8 +2502,7 @@ bool CWallet::CommitTransaction(CWalletTx& wtxNew, CReserveKey& reservekey, CCon
25022502
if (fBroadcastTransactions)
25032503
{
25042504
// Broadcast
2505-
if (!wtxNew.AcceptToMemoryPool(false, maxTxFee))
2506-
{
2505+
if (!wtxNew.AcceptToMemoryPool(maxTxFee)) {
25072506
// This must not fail. The transaction has already been signed and recorded.
25082507
LogPrintf("CommitTransaction(): Error: Transaction not valid\n");
25092508
return false;
@@ -3652,8 +3651,8 @@ int CMerkleTx::GetBlocksToMaturity() const
36523651
}
36533652

36543653

3655-
bool CMerkleTx::AcceptToMemoryPool(bool fLimitFree, CAmount nAbsurdFee)
3654+
bool CMerkleTx::AcceptToMemoryPool(const CAmount& nAbsurdFee)
36563655
{
36573656
CValidationState state;
3658-
return ::AcceptToMemoryPool(mempool, state, *this, fLimitFree, NULL, false, nAbsurdFee);
3657+
return ::AcceptToMemoryPool(mempool, state, *this, true, NULL, false, nAbsurdFee);
36593658
}

src/wallet/wallet.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ class CMerkleTx : public CTransaction
215215
bool IsInMainChain() const { const CBlockIndex *pindexRet; return GetDepthInMainChain(pindexRet) > 0; }
216216
int GetBlocksToMaturity() const;
217217
/** Pass this transaction to the mempool. Fails if absolute fee exceeds absurd fee. */
218-
bool AcceptToMemoryPool(bool fLimitFree, const CAmount nAbsurdFee);
218+
bool AcceptToMemoryPool(const CAmount& nAbsurdFee);
219219
bool hashUnset() const { return (hashBlock.IsNull() || hashBlock == ABANDON_HASH); }
220220
bool isAbandoned() const { return (hashBlock == ABANDON_HASH); }
221221
void setAbandoned() { hashBlock = ABANDON_HASH; }

0 commit comments

Comments
 (0)