Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix: make CCoinsViewMemPool support pruned entries in underlying cache #4575

Merged
merged 1 commit into from
Jul 24, 2014

Conversation

sipa
Copy link
Member

@sipa sipa commented Jul 23, 2014

Since #4505 it can happen that pcoinsTip contains pruned but existing CCoins entries, representing deleted/reorged transactions.

CCoinsViewMemPool::GetCoins does not deal correctly with this, as it first checks for an entry in the underlying cache (which can be pruned) and then for one in the mempool. Swap these, as the mempool is guaranteed never to conflict with the underlying cache, and the mempool cannot contain pruned transactions.

Thanks to @mikehearn for reporting.

@mikehearn
Copy link
Contributor

Looks good: I found this problem whilst extending the pull tester with getutxo tests, and this fixes the bug for me.

@BitcoinPullTester
Copy link

Automatic sanity-testing: PASSED, see http://jenkins.bluematt.me/pull-tester/p4575_ad08d0b95bd8e35b74f5f36cfa3c48ae9583b28c/ for binaries and test log.
This test script verifies pulls every time they are updated. It, however, dies sometimes and fails to test properly. If you are waiting on a test, please check timestamps to verify that the test.log is moving at http://jenkins.bluematt.me/pull-tester/current/
Contact BlueMatt on freenode if something looks broken.

@laanwj
Copy link
Member

laanwj commented Jul 23, 2014

Untested ACK

@laanwj laanwj merged commit ad08d0b into bitcoin:master Jul 24, 2014
laanwj added a commit that referenced this pull request Jul 24, 2014
ad08d0b Bugfix: make CCoinsViewMemPool support pruned entries in underlying cache (Pieter Wuille)
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Sep 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants