From bb072f06c9f3e888da19a8b3da98ca847c3a165e Mon Sep 17 00:00:00 2001 From: Jack Grigg Date: Fri, 1 Apr 2022 20:09:56 +0000 Subject: [PATCH] AcceptToMemoryPool: Re-add missing code comment The comment on `view.SetBackend(dummy)` was removed when we backported upstream locking PRs in zcash/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`). --- src/main.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main.cpp b/src/main.cpp index cbaa086ad..439c1b48e 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -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