Skip to content

Commit

Permalink
AcceptToMemoryPool: Re-add missing code comment
Browse files Browse the repository at this point in the history
The comment on `view.SetBackend(dummy)` was removed when we backported
upstream locking PRs in zcash#5017. The upstream commit in
question removed a locking scope but did not remove the reference to
that scope in the comment. Our backport removed the outdated comment,
but should have modified it instead, because otherwise the existence of
`view.SetBackend(dummy)` is very confusing (as it disconnects the cache
from `pcoinsTip`, on the assumption that everything we need from it has
been cached via calls to `CCoinsViewCache::HaveCoins` and
`CCoinsViewCache::HaveShieldedRequirements`).
  • Loading branch information
str4d committed Apr 4, 2022
1 parent c99e775 commit bb072f0
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1892,6 +1892,7 @@ bool AcceptToMemoryPool(

nValueIn = view.GetValueIn(tx);

// we have all inputs cached now, so switch back to dummy
view.SetBackend(dummy);

// Check for non-standard pay-to-script-hash in inputs
Expand Down

0 comments on commit bb072f0

Please sign in to comment.