Manual coin control dialog interacts badly with multiple wallets #15725

issue gwillen openend this issue on April 3, 2019
  1. gwillen commented at 8:24 am on April 3, 2019: contributor

    The coin control dialog has a single static CCoinControl object (declared in CoinControlDialog::coinControl) that it uses for all purposes.

    This causes an inappropriate mixing of state between different wallets, when multiple are loaded at the same time and you flip back and forth between them while using coin control on the sending page.

    For example, pick a wallet, use coin control to select a UTXO, hit OK. Then switch to a different wallet – so far nothing will be wrong – but now open coin control again. The UTXO in the other wallet is still selected (it will show in the summary at the top), but is not visible and can’t be unselected. If you now click ‘ok’, the main send pane will show that there is a UTXO (from the other wallet) selected.

    I can’t reproduce this 100% reliably, but if I have several wallets open I can reliably make “weird broken shit” happen with a few tries.

    When I try to perform a send in this state (having selected a UTXO that does not belong to the current wallet) I get an insufficient balance error (even though both the current wallet and the selected UTXO have sufficient balance.)

    I think the only reasonable and correct way to fix this is to rip out the static CCoinControl object, and replace it with a per-wallet one. I am happy to do this … at some point.

  2. fanquake added the label GUI on Apr 3, 2019
  3. laanwj added the label Wallet on Apr 3, 2019
  4. promag commented at 8:32 am on April 3, 2019: member
    Thanks for the report, I can take a look too.
  5. gwillen commented at 7:24 pm on April 4, 2019: contributor

    Suggested “known issue” text for 0.18 release: something like the following.

    “For advanced users who BOTH (1) have enabled coin control features, and (2) are using multiple wallets loaded at the same time: The coin control input selection dialog can erroneously retain wrong-wallet state when switching wallets using the dropdown menu. For now, it is recommended not to use coin control features with multiple wallets loaded.”

  6. gwillen commented at 9:18 pm on April 4, 2019: contributor
    Should I link the issue in the release notes? Is just “See #15725” sufficient, or how is that normally done?
  7. promag commented at 10:03 pm on April 5, 2019: member

    I can’t reproduce at all.

    Sometimes, maybe with a specific Qt version (IDK), some widgets fail to refresh when, for instance, the current wallet is changed. In those cases usually resizing the window causes the repaint.

    So, if you manage to reproduce:

    1. share the steps
    2. check if it isn’t a Qt problem.

    BTW, agree that this could be improved (even if it’s not the cause of your issue): https://github.com/bitcoin/bitcoin/blob/35991b162fd142d76d83e672002846c8a40eb794/src/qt/coincontroldialog.h#L55

  8. gwillen commented at 10:25 pm on April 5, 2019: contributor

    I do get the Qt widget refresh problem on this machine (I filed a bug report about it at one point, and I was not aware then of anybody else ever seeing it; perhaps I’m the only one?)

    I’m pretty sure this is not that, though. Resizing the window doesn’t make any difference, and the issue is not purely visual (i.e. when I’m in the state where zero of three UTXOs displayed are checked, and the top of the window says “Quantity: 1”, I can check all three and get the window to read “Quantity: 4” with all three boxes checked.)

  9. promag commented at 2:19 pm on April 14, 2019: member
    @gwillen thanks, I’ll try to reproduce that.
  10. promag commented at 0:17 am on November 12, 2019: member
    Can I get this assigned to me?
  11. laanwj assigned promag on Nov 12, 2019
  12. Sjors commented at 6:59 pm on November 19, 2019: member
    I’m able to reproduce “weird” behavior, i.e. coins selected in one wallet showing up in another. Will look at the fix PR.
  13. hebasto commented at 2:20 am on May 6, 2020: member

    I can reliably reproduce the issue:

    DeepinScreenshot_bitcoin-qt_20200506051916

  14. jonasschnelli closed this on May 13, 2020

  15. sidhujag referenced this in commit 2dde03529c on May 14, 2020
  16. UdjinM6 referenced this in commit 32122a5b9d on Oct 16, 2020
  17. UdjinM6 referenced this in commit 98cc6a3562 on Oct 16, 2020
  18. UdjinM6 referenced this in commit cde2defb62 on Oct 16, 2020
  19. UdjinM6 referenced this in commit dbabf35b43 on Oct 16, 2020
  20. UdjinM6 referenced this in commit 02efeb0c74 on Nov 9, 2020
  21. DrahtBot locked this on Feb 15, 2022
  22. gades referenced this in commit ae81c7f39d on Mar 10, 2022

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-10-04 22:12 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me