(try to) add transaction to memory pool with a specified acceptance time **/
| 1005 | |
| 1006 | /** (try to) add transaction to memory pool with a specified acceptance time **/ |
| 1007 | static bool AcceptToMemoryPoolWithTime(const CChainParams& chainparams, CTxMemPool& pool, CValidationState &state, const CTransactionRef &tx, |
| 1008 | bool* pfMissingInputs, int64_t nAcceptTime, std::list<CTransactionRef>* plTxnReplaced, |
| 1009 | bool bypass_limits, const CAmount nAbsurdFee, bool test_accept) |
| 1010 | { |
| 1011 | std::vector<COutPoint> coins_to_uncache; |
| 1012 | bool res = AcceptToMemoryPoolWorker(chainparams, pool, state, tx, pfMissingInputs, nAcceptTime, plTxnReplaced, bypass_limits, nAbsurdFee, coins_to_uncache, test_accept); |
| 1013 | if (!res) { |
| 1014 | for (const COutPoint& hashTx : coins_to_uncache) |
| 1015 | pcoinsTip->Uncache(hashTx); |
| 1016 | } |
| 1017 | // After we've (potentially) uncached entries, ensure our coins cache is still within its size limits |
| 1018 | CValidationState stateDummy; |
| 1019 | FlushStateToDisk(chainparams, stateDummy, FlushStateMode::PERIODIC); |
| 1020 | return res; |
| 1021 | } |
| 1022 | |
| 1023 | bool AcceptToMemoryPool(CTxMemPool& pool, CValidationState &state, const CTransactionRef &tx, |
| 1024 | bool* pfMissingInputs, std::list<CTransactionRef>* plTxnReplaced, |
no test coverage detected