Mempool will accept tx with joinsplits and the default z_sendmany fee.
Issue #1851 shows that a zaddr->taddr can be rejected from mempools due to not meeting fee requirements given the size of the transaction. Fee calculation for joinsplit txs has not yet been agreed upon, so during this interim period, this patch ensures joinsplit txs using the default fee are not rejected due to an insufficient fee.
This commit is contained in:
18
src/main.cpp
18
src/main.cpp
@@ -26,6 +26,7 @@
|
||||
#include "util.h"
|
||||
#include "utilmoneystr.h"
|
||||
#include "validationinterface.h"
|
||||
#include "wallet/asyncrpcoperation_sendmany.h"
|
||||
|
||||
#include <sstream>
|
||||
|
||||
@@ -1170,12 +1171,17 @@ bool AcceptToMemoryPool(CTxMemPool& pool, CValidationState &state, const CTransa
|
||||
CTxMemPoolEntry entry(tx, nFees, GetTime(), dPriority, chainActive.Height(), mempool.HasNoInputsOf(tx));
|
||||
unsigned int nSize = entry.GetTxSize();
|
||||
|
||||
// Don't accept it if it can't get into a block
|
||||
CAmount txMinFee = GetMinRelayFee(tx, nSize, true);
|
||||
if (fLimitFree && nFees < txMinFee)
|
||||
return state.DoS(0, error("AcceptToMemoryPool: not enough fees %s, %d < %d",
|
||||
hash.ToString(), nFees, txMinFee),
|
||||
REJECT_INSUFFICIENTFEE, "insufficient fee");
|
||||
// Accept a tx if it contains joinsplits and has at least the default fee specified by z_sendmany.
|
||||
if (tx.vjoinsplit.size() > 0 && nFees >= ASYNC_RPC_OPERATION_DEFAULT_MINERS_FEE) {
|
||||
// In future we will we have more accurate and dynamic computation of fees for tx with joinsplits.
|
||||
} else {
|
||||
// Don't accept it if it can't get into a block
|
||||
CAmount txMinFee = GetMinRelayFee(tx, nSize, true);
|
||||
if (fLimitFree && nFees < txMinFee)
|
||||
return state.DoS(0, error("AcceptToMemoryPool: not enough fees %s, %d < %d",
|
||||
hash.ToString(), nFees, txMinFee),
|
||||
REJECT_INSUFFICIENTFEE, "insufficient fee");
|
||||
}
|
||||
|
||||
// Require that free transactions have sufficient priority to be mined in the next block.
|
||||
if (GetBoolArg("-relaypriority", false) && nFees < ::minRelayTxFee.GetFee(nSize) && !AllowFree(view.GetPriority(tx, chainActive.Height() + 1))) {
|
||||
|
||||
Reference in New Issue
Block a user