MCPcopy Create free account
hub / github.com/LUX-Core/lux / GetMinRelayFee

Function GetMinRelayFee

src/main.cpp:957–983  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

955}
956
957CAmount GetMinRelayFee(const CTransaction& tx, unsigned int nBytes, bool fAllowFree)
958{
959 {
960 LOCK(mempool.cs);
961 uint256 hash = tx.GetHash();
962 double dPriorityDelta = 0;
963 CAmount nFeeDelta = 0;
964 mempool.ApplyDeltas(hash, dPriorityDelta, nFeeDelta);
965 if (dPriorityDelta > 0 || nFeeDelta > 0)
966 return 0;
967 }
968
969 CAmount nMinFee = ::minRelayTxFee.GetFee((size_t)nBytes);
970
971 if (fAllowFree) {
972 // There is a free transaction area in blocks created by most miners,
973 // * If we are relaying we allow transactions up to DEFAULT_BLOCK_PRIORITY_SIZE - 1000
974 // to be considered to fall into this category. We don't want to encourage sending
975 // multiple transactions instead of one big transaction to avoid fees.
976 if (nBytes < (DEFAULT_BLOCK_PRIORITY_SIZE - 1000))
977 nMinFee = 0;
978 }
979
980 if (!MoneyRange(nMinFee))
981 nMinFee = MAX_MONEY;
982 return nMinFee;
983}
984
985
986bool AcceptToMemoryPool(CTxMemPool& pool, CValidationState& state, const CTransaction& tx, bool fLimitFree, bool* pfMissingInputs, list<CTransactionRef>* plTxnReplaced, bool fRejectInsaneFee, bool ignoreFees)

Callers 2

AcceptToMemoryPoolFunction · 0.85
AcceptableInputsFunction · 0.85

Calls 4

MoneyRangeFunction · 0.85
ApplyDeltasMethod · 0.80
GetFeeMethod · 0.80
GetHashMethod · 0.45

Tested by

no test coverage detected