File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -602,14 +602,15 @@ void CTxMemPool::ClearPrioritisation(const uint256 hash)
602
602
CCoinsViewMemPool::CCoinsViewMemPool (CCoinsView &baseIn, CTxMemPool &mempoolIn) : CCoinsViewBacked(baseIn), mempool(mempoolIn) { }
603
603
604
604
bool CCoinsViewMemPool::GetCoins (const uint256 &txid, CCoins &coins) {
605
- if (base->GetCoins (txid, coins))
606
- return true ;
605
+ // If an entry in the mempool exists, always return that one, as it's guaranteed to never
606
+ // conflict with the underlying cache, and it cannot have pruned entries (as it contains full)
607
+ // transactions. First checking the underlying cache risks returning a pruned entry instead.
607
608
CTransaction tx;
608
609
if (mempool.lookup (txid, tx)) {
609
610
coins = CCoins (tx, MEMPOOL_HEIGHT);
610
611
return true ;
611
612
}
612
- return false ;
613
+ return (base-> GetCoins (txid, coins) && !coins. IsPruned ()) ;
613
614
}
614
615
615
616
bool CCoinsViewMemPool::HaveCoins (const uint256 &txid) {
You can’t perform that action at this time.
0 commit comments