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

Update the wallet best block marker when pruning #7502

Merged
merged 1 commit into from Feb 10, 2016
Merged

Conversation

@sipa
Copy link
Member

sipa commented Feb 10, 2016

When pruning, make sure that we update the wallet best block before deleting any files.

@laanwj laanwj added the Wallet label Feb 10, 2016
@laanwj
Copy link
Member

laanwj commented Feb 10, 2016

utACK

Note: intended to fix #7494.

@sipa sipa force-pushed the sipa:betterflush branch to e4eebb6 Feb 10, 2016
@sipa sipa changed the title Update the wallet best block marker before pruning Update the wallet best block marker when pruning Feb 10, 2016
@sipa
Copy link
Member Author

sipa commented Feb 10, 2016

Updated the logic to just always update the wallet best block when the chainstate is flushed. Both are relatively slow operations, so this shouldn't have a strong effect on performance.

There are further problems with the flushing logic, which will require a more invasive change, but those problems can only trigger when a crash during flushing happens.

@morcos
Copy link
Member

morcos commented Feb 10, 2016

utACK

@sdaftuar
Copy link
Member

sdaftuar commented Feb 10, 2016

utACK. Needs backport!

@sdaftuar
Copy link
Member

sdaftuar commented Feb 10, 2016

Verified that I can trigger the problem reported in #7494 by stopping bitcoind cleanly after the first blocks are pruned (restarting then fails).

Verified further that this pull fixes the issue.

ACK e4eebb6

@laanwj
Copy link
Member

laanwj commented Feb 10, 2016

@sdaftuar thanks for testing!

@laanwj laanwj merged commit e4eebb6 into bitcoin:master Feb 10, 2016
laanwj added a commit that referenced this pull request Feb 10, 2016
e4eebb6 Update the wallet best block marker when pruning (Pieter Wuille)
laanwj added a commit that referenced this pull request Feb 10, 2016
Github-Pull: #7502
Rebased-From: e4eebb6
@laanwj
Copy link
Member

laanwj commented Feb 10, 2016

Cherry-picked to 0.12 as 1329963

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

4 participants
You can’t perform that action at this time.