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

[Backport] Preemptively catch a few potential bugs #1534

Merged
merged 1 commit into from
May 20, 2020

Conversation

furszy
Copy link

@furszy furszy commented Apr 15, 2020

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

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.

Coming from upstream@228d2385254ee136ef64d229a414fdd7cefea9a0
src/main.cpp Outdated
Comment on lines 2519 to 2520
if (!fJustCheck)
view.SetBestBlock(pindex->GetBlockHash());

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need for this. As if fJustCheck is true, we've already exited the function by now (line 2458).

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah good catch. Just dropped the last commit.

Copy link

@random-zebra random-zebra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utACK e337706

Copy link
Collaborator

@Fuzzbawls Fuzzbawls left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utACK e337706

perpetual updating PIVX Core to BTC Core automation moved this from In Progress to Ready May 20, 2020
@random-zebra random-zebra merged commit d45c58e into PIVX-Project:master May 20, 2020
perpetual updating PIVX Core to BTC Core automation moved this from Ready to Done May 20, 2020
@furszy furszy deleted the 2020_backport_5580 branch November 29, 2022 14:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

None yet

3 participants