| 955 | } |
| 956 | |
| 957 | CAmount 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 | |
| 986 | bool AcceptToMemoryPool(CTxMemPool& pool, CValidationState& state, const CTransaction& tx, bool fLimitFree, bool* pfMissingInputs, list<CTransactionRef>* plTxnReplaced, bool fRejectInsaneFee, bool ignoreFees) |
no test coverage detected