1590@@ -1581,6 +1591,8 @@ bool AcceptToMemoryPool(CTxMemPool& pool, CValidationState &state, const CTransa
1591 BOOST_FOREACH(const uint256& hashTx, vHashTxToUncache)
1592 pcoinsTip->Uncache(hashTx);
1593 }
1594+ // After we've (potentially) uncached entries, ensure our coins cache is still within its size limits
1595+ FlushStateToDisk(state, FLUSH_STATE_PERIODIC);
I don’t know the mempool behavior well enough to review this… is it ok to be potentially flushing while processing orphans recursively?
FlushStateToDisk shouldn’t effect anything that mempool (or anything, actually) cares about except for memory usage, I believe.
Minor edge case: a non-fatal error in FlushState (currently only low disk space) would override a MODE_INVALID, preventing misbehavior accounting and reject messages for the current tx. Since MODE_ERROR from FlushState is ignored in this case anyway, I think it’d be more robust to give FlushState a dummy CValidationState.
Heh, true, though in all of those cases we AbortNode, sooooo
FlushStateToDisk should be fine to be called as long as no child CCoinsViewCache exists (which isn’t the case here).