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

[wallet-tool] Close bdb when flushing wallet #15390

Merged
merged 1 commit into from Feb 13, 2019

Conversation

Projects
None yet
5 participants
@jnewbery
Copy link
Member

commented Feb 12, 2019

bdb would not be closed when closing the wallet in wallet-tool. Fix this by calling wallet->flush with true.

@jnewbery

This comment has been minimized.

Copy link
Member Author

commented Feb 12, 2019

Suggested by @MarcoFalke here: #13926 (comment)

ping @promag

@@ -93,7 +93,7 @@ static void ReleaseWallet(CWallet* wallet)
// so that it's in sync with the current chainstate.
wallet->WalletLogPrintf("Releasing wallet\n");
wallet->BlockUntilSyncedToCurrentChain();
wallet->Flush();
wallet->Flush(true);

This comment has been minimized.

Copy link
@promag

promag Feb 12, 2019

Member

This is not right, this will mess other dbs in the same env.

This comment has been minimized.

Copy link
@jnewbery

jnewbery Feb 12, 2019

Author Member

Thanks @promag . Fixed

[wallet] Close bdb when flushing wallet.
bdb would not be closed when closing the wallet in wallet-tool. Fix this
by calling wallet->flush with true.

@jnewbery jnewbery force-pushed the jnewbery:wallet_flush branch from d4d26d0 to 318b1f7 Feb 12, 2019

@laanwj

This comment has been minimized.

Copy link
Member

commented Feb 13, 2019

utACK 318b1f7

@MarcoFalke MarcoFalke changed the title [wallet] Close bdb when flushing wallet. [wallet-tool] Close bdb when flushing wallet Feb 13, 2019

@MarcoFalke

This comment has been minimized.

Copy link
Member

commented Feb 13, 2019

Changed title prefix to [wallet-tool]

@meshcollider

This comment has been minimized.

Copy link
Member

commented Feb 13, 2019

utACK 318b1f7

@promag

This comment has been minimized.

Copy link
Member

commented Feb 13, 2019

Is there currently a strong reason to have the shutdown argument in Flush()?

@MarcoFalke

This comment has been minimized.

Copy link
Member

commented Feb 13, 2019

@promag I don't think so, what would be the alternative?

MarcoFalke added a commit to MarcoFalke/bitcoin that referenced this pull request Feb 13, 2019

Merge bitcoin#15390: [wallet-tool] Close bdb when flushing wallet
318b1f7 [wallet] Close bdb when flushing wallet. (John Newbery)

Pull request description:

  bdb would not be closed when closing the wallet in wallet-tool. Fix this by calling wallet->flush with true.

Tree-SHA512: f722e527e4806eca5254221e944f57853d11bf89a9264309fa558a6cc2b23feefb7bb2963e87b4fad9cfb31ac4cffe563688988e0614a481a8ff1d393aceb132

@MarcoFalke MarcoFalke merged commit 318b1f7 into bitcoin:master Feb 13, 2019

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@jnewbery

This comment has been minimized.

Copy link
Member Author

commented Feb 13, 2019

Is there currently a strong reason to have the shutdown argument in Flush()?

I don't believe so. It's a holdover from https://github.com/bitcoin/bitcoin/pull/10767/files

@promag

This comment has been minimized.

Copy link
Member

commented Feb 13, 2019

@jnewbery @MarcoFalke thanks, so I guess we all agree it can be cleaned up.

utACK 318b1f7.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.