Skip to content

Preemptively catch a few potential bugs#5580

Merged
laanwj merged 2 commits intobitcoin:masterfrom
luke-jr:201412-catch_bugs
Jan 2, 2015
Merged

Preemptively catch a few potential bugs#5580
laanwj merged 2 commits intobitcoin:masterfrom
luke-jr:201412-catch_bugs

Conversation

@luke-jr
Copy link
Copy Markdown
Member

@luke-jr luke-jr commented Dec 31, 2014

This causes CCoinsViewCache(CCoinsViewCache) to fail at compile-time rather than copy an existing cache (most likely the caller intends to sub-cache it)

It also makes ConnectBlock's fJustCheck work correctly for the genesis block, just in case it gets in there somehow.

It is easily confused with CCoinsViewCache(CCoinsView*), which creates a sub-cache, but instead of creating a sub-cache, the copy constructor would copy the original and use that original's base, defeating the intended isolation.
@laanwj
Copy link
Copy Markdown
Member

laanwj commented Dec 31, 2014

utACK

@sipa
Copy link
Copy Markdown
Member

sipa commented Dec 31, 2014

utACK

@laanwj laanwj merged commit 1b178a7 into bitcoin:master Jan 2, 2015
laanwj added a commit that referenced this pull request Jan 2, 2015
1b178a7 Bugfix: ConnectBlock: In case the genesis block gets in with fJustCheck, behave correctly (Luke Dashjr)
228d238 Make CCoinsViewCache's copy constructor private (Luke Dashjr)
@luke-jr luke-jr deleted the 201412-catch_bugs branch January 5, 2015 08:00
random-zebra added a commit to PIVX-Project/PIVX that referenced this pull request May 20, 2020
e337706 Make CCoinsViewCache's copy constructor private (furszy)

Pull request description:

  This causes CCoinsViewCache(CCoinsViewCache) to fail at compile-time rather than copy an existing cache (most likely the caller intends to sub-cache it)

  It also makes ConnectBlock's fJustCheck work correctly for the genesis block, just in case it gets in there somehow.

  Coming from upstream@[5580](bitcoin#5580)

ACKs for top commit:
  random-zebra:
    utACK e337706
  Fuzzbawls:
    utACK e337706

Tree-SHA512: a4494ba6cd0bcb36ca5a37e6e30770d5a7e5d05ff9f98ff333aa7c72ef0470cca30fa83e7e81895ceb0e74cef59aa41458dd742223d1602b5900df9f1292a524
@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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants