Skip to content

Update the wallet best block marker when pruning - #7502

Merged
laanwj merged 1 commit into
bitcoin:masterfrom
sipa:betterflush
Feb 10, 2016
Merged

laanwj merged 1 commit into
bitcoin:masterfrom
sipa:betterflush

Conversation

@sipa

@sipa sipa commented Feb 10, 2016

Copy link
Copy Markdown
Member

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

laanwj commented Feb 10, 2016

Copy link
Copy Markdown
Member

utACK

Note: intended to fix #7494.

@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

sipa commented Feb 10, 2016

Copy link
Copy Markdown
Member Author

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

morcos commented Feb 10, 2016

Copy link
Copy Markdown
Contributor

utACK

@sdaftuar

Copy link
Copy Markdown
Member

utACK. Needs backport!

@sdaftuar

Copy link
Copy Markdown
Member

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

laanwj commented Feb 10, 2016

Copy link
Copy Markdown
Member

@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 pushed a commit that referenced this pull request Feb 10, 2016
@laanwj

laanwj commented Feb 10, 2016

Copy link
Copy Markdown
Member

Cherry-picked to 0.12 as 1329963

@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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants