Skip to content

Conversation

maflcko
Copy link
Member

@maflcko maflcko commented Oct 7, 2019

RPC errors and warnings are shown as popups in the GUI instead of being returned to the RPC caller. For example,

$ ./src/bitcoin-cli loadwallet $(pwd)/./test/functional/data/wallets/high_minversion/
error code: -4
error message:
Wallet loading failed.

gives me a GUI popup and no reason why loading the wallet failed.

After this pull request:

$ ./src/bitcoin-cli loadwallet $(pwd)/./test/functional/data/wallets/high_minversion/
error code: -4
error message:
Wallet loading failed: Error loading /home/marco/workspace/btc_bitcoin_core/./test/functional/data/wallets/high_minversion/wallet.dat: Wallet requires newer version of Bitcoin Core

@maflcko maflcko added this to the 0.20.0 milestone Oct 7, 2019
@fanquake fanquake added the Wallet label Oct 7, 2019
@maflcko
Copy link
Member Author

maflcko commented Oct 7, 2019

While this is a bugfix, it is not a regression and it can wait until 0.20.0

@promag
Copy link
Contributor

promag commented Oct 7, 2019

Concept ACK.

@DrahtBot
Copy link
Contributor

DrahtBot commented Oct 7, 2019

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Conflicts

Reviewers, this pull request conflicts with the following ones:

  • #16963 (wallet: Fix unique_ptr usage in boost::signals2 by promag)
  • #16923 (wallet: Fix duplicates fileid exception on start by promag)
  • #16839 (Replace Connman and BanMan globals with Node local by ryanofsky)
  • #16224 (gui: Bilingual GUI error messages by hebasto)
  • #15761 (Replace -upgradewallet startup option with upgradewallet RPC by achow101)
  • #15204 (gui: Add Open External Wallet action by promag)

If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

@hebasto
Copy link
Member

hebasto commented Oct 7, 2019

Concept ACK.

@laanwj
Copy link
Member

laanwj commented Oct 8, 2019

Whoops, yes this is kind of an oversight.

@jonasschnelli
Copy link
Contributor

Tested ACK fa99a26 - tested the loadwallet failure case with gui + -server as well as the same command in the GUI console. Works now as intended. Code review ACK.

It is a relatively large but somehow sane change. I'm okay with this as a 0.19 bugfix.

Copy link
Contributor

@promag promag left a comment

Choose a reason for hiding this comment

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

Tested ACK fa99a26.

Could split in 2 commits: the first refactors to a vector of warnings, the second moves calls to chain.initWarning from CWallet::CreateWalletFromFile to LoadWallets.

One comment inline.

@maflcko maflcko force-pushed the 1909-walletGuiPopupRpc branch from fa99a26 to fa5fdcc Compare October 8, 2019 16:57
@maflcko
Copy link
Member Author

maflcko commented Oct 8, 2019

Force pushed changes requested by @promag and @jonasschnelli

@maflcko maflcko force-pushed the 1909-walletGuiPopupRpc branch from fa5fdcc to facec1c Compare October 8, 2019 17:02
@promag
Copy link
Contributor

promag commented Oct 9, 2019

Could split in 2 commits: the first refactors to a vector of warnings, the second moves calls to chain.initWarning from CWallet::CreateWalletFromFile to LoadWallets.

@MarcoFalke just wondering if you have considered this, or it doesn't even matter.

@maflcko
Copy link
Member Author

maflcko commented Oct 9, 2019

@promag Not sure if it does help review to split up, so I kept it in one commit for now. Waiting for other to chime in...

@laanwj
Copy link
Member

laanwj commented Oct 21, 2019

Code review ACK facec1c

I don't think it's necessary to split this up into multiple commits.

~0 on backporting this or not.

laanwj added a commit that referenced this pull request Oct 21, 2019
facec1c wallet: Avoid showing GUI popups on RPC errors (MarcoFalke)

Pull request description:

  RPC errors and warnings are shown as popups in the GUI instead of being returned to the RPC caller. For example,

  ```
  $ ./src/bitcoin-cli loadwallet $(pwd)/./test/functional/data/wallets/high_minversion/
  error code: -4
  error message:
  Wallet loading failed.
  ```

  gives me a GUI popup and no reason why loading the wallet failed.

  After this pull request:

  ```
  $ ./src/bitcoin-cli loadwallet $(pwd)/./test/functional/data/wallets/high_minversion/
  error code: -4
  error message:
  Wallet loading failed: Error loading /home/marco/workspace/btc_bitcoin_core/./test/functional/data/wallets/high_minversion/wallet.dat: Wallet requires newer version of Bitcoin Core

ACKs for top commit:
  laanwj:
    Code review ACK facec1c

Tree-SHA512: c8274bbb02cfcf71676eeec1e773e51fb3538cf93f82e7cb8536f4716d44ed819cdc162dfc039ac7386a4db381a734cdb27fd32567043a1180c02519fbcba194
@laanwj laanwj merged commit facec1c into bitcoin:master Oct 21, 2019
sidhujag pushed a commit to syscoin/syscoin that referenced this pull request Oct 21, 2019
facec1c wallet: Avoid showing GUI popups on RPC errors (MarcoFalke)

Pull request description:

  RPC errors and warnings are shown as popups in the GUI instead of being returned to the RPC caller. For example,

  ```
  $ ./src/bitcoin-cli loadwallet $(pwd)/./test/functional/data/wallets/high_minversion/
  error code: -4
  error message:
  Wallet loading failed.
  ```

  gives me a GUI popup and no reason why loading the wallet failed.

  After this pull request:

  ```
  $ ./src/bitcoin-cli loadwallet $(pwd)/./test/functional/data/wallets/high_minversion/
  error code: -4
  error message:
  Wallet loading failed: Error loading /home/marco/workspace/btc_bitcoin_core/./test/functional/data/wallets/high_minversion/wallet.dat: Wallet requires newer version of Bitcoin Core

ACKs for top commit:
  laanwj:
    Code review ACK facec1c

Tree-SHA512: c8274bbb02cfcf71676eeec1e773e51fb3538cf93f82e7cb8536f4716d44ed819cdc162dfc039ac7386a4db381a734cdb27fd32567043a1180c02519fbcba194
@maflcko maflcko deleted the 1909-walletGuiPopupRpc branch November 11, 2019 19:16
MarkLTZ added a commit to litecoinz-core/litecoinz that referenced this pull request Nov 17, 2019
maflcko pushed a commit that referenced this pull request Nov 20, 2019
faffa7f wallet: Avoid showing GUI popups on RPC errors (take 2) (MarcoFalke)

Pull request description:

  Commit 8b0d82b claims "This commit does not change behavior." However, it re-introduced the bug I tried to fix in #17070

ACKs for top commit:
  ryanofsky:
    Code review ACK faffa7f

Tree-SHA512: 99987f80c76414dca40c7d76b2fe4ea853debbe3c49e7acdeab2596c726a2935c468f4484d49212e65ecc9c8b0d861c0c2b83c1ddfc07670540699199dbfecb0
sidhujag pushed a commit to syscoin/syscoin that referenced this pull request Nov 21, 2019
…take 2)

faffa7f wallet: Avoid showing GUI popups on RPC errors (take 2) (MarcoFalke)

Pull request description:

  Commit 8b0d82b claims "This commit does not change behavior." However, it re-introduced the bug I tried to fix in bitcoin#17070

ACKs for top commit:
  ryanofsky:
    Code review ACK faffa7f

Tree-SHA512: 99987f80c76414dca40c7d76b2fe4ea853debbe3c49e7acdeab2596c726a2935c468f4484d49212e65ecc9c8b0d861c0c2b83c1ddfc07670540699199dbfecb0
laanwj added a commit that referenced this pull request Jan 8, 2020
6d6a7a8 gui: Fix duplicate wallet showing up (João Barbosa)
81ea66c Drop signal CClientUIInterface::LoadWallet (Russell Yanofsky)

Pull request description:

  This PR includes 2 fixes:
   - prevent GUI LoadWallet handlers from crashing on startup when multiple handlers are attached, because the first handler takes ownership of the wallet unique pointer. Now every handler will receive its own unique pointer;

   - prevent showing a wallet twice in the GUI on startup due to a race with `loadwallet`.

  Fixes #16937

ACKs for top commit:
  fjahr:
    code review ACK 6d6a7a8
  ryanofsky:
    Code review ACK 6d6a7a8. No changes since last ACK other than rebase due to #17070
  kallewoof:
    Code review ACK 6d6a7a8

Tree-SHA512: 7f0658c9011f81dfa176a094c2263448ee1d14fda7dc94e8b55ee9c8b81538bd2d1e4bf8a8dbfcd029ebfc9feb6d3cda9dee3f911122df0a4b1e0ca75f653ba4
sidhujag pushed a commit to syscoin/syscoin that referenced this pull request Jan 8, 2020
6d6a7a8 gui: Fix duplicate wallet showing up (João Barbosa)
81ea66c Drop signal CClientUIInterface::LoadWallet (Russell Yanofsky)

Pull request description:

  This PR includes 2 fixes:
   - prevent GUI LoadWallet handlers from crashing on startup when multiple handlers are attached, because the first handler takes ownership of the wallet unique pointer. Now every handler will receive its own unique pointer;

   - prevent showing a wallet twice in the GUI on startup due to a race with `loadwallet`.

  Fixes bitcoin#16937

ACKs for top commit:
  fjahr:
    code review ACK 6d6a7a8
  ryanofsky:
    Code review ACK 6d6a7a8. No changes since last ACK other than rebase due to bitcoin#17070
  kallewoof:
    Code review ACK 6d6a7a8

Tree-SHA512: 7f0658c9011f81dfa176a094c2263448ee1d14fda7dc94e8b55ee9c8b81538bd2d1e4bf8a8dbfcd029ebfc9feb6d3cda9dee3f911122df0a4b1e0ca75f653ba4
sidhujag pushed a commit to syscoin-core/syscoin that referenced this pull request Nov 10, 2020
…take 2)

faffa7f wallet: Avoid showing GUI popups on RPC errors (take 2) (MarcoFalke)

Pull request description:

  Commit 8b0d82b claims "This commit does not change behavior." However, it re-introduced the bug I tried to fix in bitcoin#17070

ACKs for top commit:
  ryanofsky:
    Code review ACK faffa7f

Tree-SHA512: 99987f80c76414dca40c7d76b2fe4ea853debbe3c49e7acdeab2596c726a2935c468f4484d49212e65ecc9c8b0d861c0c2b83c1ddfc07670540699199dbfecb0
sidhujag pushed a commit to syscoin-core/syscoin that referenced this pull request Nov 10, 2020
6d6a7a8 gui: Fix duplicate wallet showing up (João Barbosa)
81ea66c Drop signal CClientUIInterface::LoadWallet (Russell Yanofsky)

Pull request description:

  This PR includes 2 fixes:
   - prevent GUI LoadWallet handlers from crashing on startup when multiple handlers are attached, because the first handler takes ownership of the wallet unique pointer. Now every handler will receive its own unique pointer;

   - prevent showing a wallet twice in the GUI on startup due to a race with `loadwallet`.

  Fixes bitcoin#16937

ACKs for top commit:
  fjahr:
    code review ACK 6d6a7a8
  ryanofsky:
    Code review ACK 6d6a7a8. No changes since last ACK other than rebase due to bitcoin#17070
  kallewoof:
    Code review ACK 6d6a7a8

Tree-SHA512: 7f0658c9011f81dfa176a094c2263448ee1d14fda7dc94e8b55ee9c8b81538bd2d1e4bf8a8dbfcd029ebfc9feb6d3cda9dee3f911122df0a4b1e0ca75f653ba4
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Feb 15, 2022
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.

7 participants