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

@jnewbery
Copy link
Member

@jnewbery jnewbery 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
Copy link
Member Author

@jnewbery jnewbery commented Feb 12, 2019

Suggested by @MarcoFalke here: #13926 (comment)

ping @promag

Loading

@@ -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);
Copy link
Member

@promag promag Feb 12, 2019

Choose a reason for hiding this comment

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

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

Loading

Copy link
Member Author

@jnewbery jnewbery Feb 12, 2019

Choose a reason for hiding this comment

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

Thanks @promag . Fixed

Loading

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

@laanwj laanwj commented Feb 13, 2019

utACK 318b1f7

Loading

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

@MarcoFalke MarcoFalke commented Feb 13, 2019

Changed title prefix to [wallet-tool]

Loading

@meshcollider
Copy link
Member

@meshcollider meshcollider commented Feb 13, 2019

utACK 318b1f7

Loading

@promag
Copy link
Member

@promag promag commented Feb 13, 2019

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

Loading

@MarcoFalke
Copy link
Member

@MarcoFalke MarcoFalke commented Feb 13, 2019

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

Loading

MarcoFalke added a commit to MarcoFalke/bitcoin-core that referenced this issue Feb 13, 2019
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
Loading
@jnewbery
Copy link
Member Author

@jnewbery jnewbery 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

Loading

@promag
Copy link
Member

@promag promag commented Feb 13, 2019

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

utACK 318b1f7.

Loading

jasonbcox pushed a commit to Bitcoin-ABC/bitcoin-abc that referenced this issue Sep 3, 2020
Summary:
[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.

---

Backport of Core [[bitcoin/bitcoin#15390 | PR15390]]

Test Plan:
  ninja check check-functional

Reviewers: #bitcoin_abc, deadalnix

Reviewed By: #bitcoin_abc, deadalnix

Subscribers: deadalnix

Differential Revision: https://reviews.bitcoinabc.org/D7327
z8674558 added a commit to z8674558/dash that referenced this issue Nov 27, 2021
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

5 participants