Fix multiwallet transaction notifications #120

pull promag wants to merge 3 commits into bitcoin-core:master from promag:2020-10-fix-transaction-notifications changing 1 files +39 −36
  1. promag commented at 0:47 am on October 28, 2020: contributor

    Currently vQueueNotifications holds transactions of any wallet, but the queue is dispatched on a given wallet and it assumes notifications are of that wallet.

    This means that some transactions can be missed if multiple wallets are loaded.

    Fix this by having a queue for each wallet.

  2. move-only: Define TransactionNotification before TransactionTablePriv
    This is needed because next commit moves vQueueNotifications to
    TransactionTablePriv member.
    7b3b2303f4
  3. qt: Make transaction notification queue wallet specific
    Drop global vQueueNotifications and make one for each wallet.
    989e579d07
  4. promag requested review from ryanofsky on Oct 28, 2020
  5. promag requested review from hebasto on Oct 28, 2020
  6. promag requested review from jonasschnelli on Oct 28, 2020
  7. in src/qt/transactiontablemodel.cpp:737 in 5ff42b72e9 outdated
    733@@ -734,7 +734,7 @@ void TransactionTablePriv::ShowProgress(const std::string &title, int nProgress)
    734         }
    735         for (unsigned int i = 0; i < vQueueNotifications.size(); ++i)
    736         {
    737-            if (vQueueNotifications.size() - i <= 10) {
    738+            if (vQueueNotifications.size() == 10 + 1 + i) {
    


    ryanofsky commented at 6:07 pm on October 28, 2020:

    In commit “qt: Enqueue setProcessingQueuedTransactions(false) only once” (5ff42b72e93508dfae41e082bbbc7c7ee4aacf6b)

    This is kind of hard to follow, and not 100% sure I understand it. IIUC, calling setProcessingQueuedTransactions with false argument turns on balloons, calling it with true argument turns off balloons.

    Previously if the queue size was more than 10, balloons were turned off before looping through transactions. Then for every transaction starting at i >= size-10 (i.e. for the most recent 10 transactions) balloons were turned on before updating each transaction.

    Now balloons are turned on at i == size-11 so an extra balloon will be shown. (For example if size is 11, balloons are now turned on at i=0 instead of i=1).

    If this is right, I’d make a few suggestions:

    1. Update commit description to say what motivation for the change is: e.g. that this is a optimization not supposed to change behavior. Not a bugfix or something else.
    2. Drop + 1 term which does not seem correct
    3. Add comment before if statement like // Re-enable balloons for the most recent 10 transactions
    4. Maybe write expression as i == size-10 or i + 10 == size instead of size == 10 + i, which seems more obscure. The only variable in the expression is i (everything else is constant) so it’s good to emphasize i writing it at the beginning.

    promag commented at 6:18 pm on October 28, 2020:
    Ok, I’ll just drop this commit, it’s unrelated anyway to the PR goal. This ballon filtering should be done elsewhere anyway.

    promag commented at 12:56 pm on November 1, 2020:
    Removed 5ff42b7,
  8. ryanofsky commented at 6:13 pm on October 28, 2020: contributor
    Code review almost-ACK 278ad5f47549cf88cce3e8684ab2e341c2e3c8c0. I think there’s a minor off by one error in the third commit, and it doesn’t seem as clear as it could be, but otherwise this looks very good
  9. refactor: qt: Use vQueueNotifications.clear() 241434200e
  10. promag force-pushed on Nov 1, 2020
  11. promag commented at 12:57 pm on November 1, 2020: contributor
    @jonasschnelli @fanquake this is a bugfix.
  12. hebasto approved
  13. hebasto commented at 10:53 am on November 2, 2020: member

    ACK 241434200ec2067673d8522fee4f1228abfd8247, I have reviewed the code and it looks OK, I agree it can be merged.

    nit: Could follow our style guide (at least apply clang-format-diff.py) for non-move-only commits?

  14. ryanofsky approved
  15. ryanofsky commented at 1:02 am on November 11, 2020: contributor
    Code review ACK 241434200ec2067673d8522fee4f1228abfd8247. Only change is dropping one commit
  16. jonasschnelli added this to the milestone 0.21.1 on Nov 12, 2020
  17. jonasschnelli removed this from the milestone 0.21.1 on Nov 12, 2020
  18. jonasschnelli added this to the milestone 0.21.0 on Nov 12, 2020
  19. jonasschnelli commented at 10:02 am on November 12, 2020: contributor
    utACK 241434200ec2067673d8522fee4f1228abfd8247
  20. jonasschnelli merged this on Nov 12, 2020
  21. jonasschnelli closed this on Nov 12, 2020

  22. promag deleted the branch on Nov 12, 2020
  23. sidhujag referenced this in commit 340957c6be on Nov 12, 2020
  24. willyko referenced this in commit 286658e381 on Nov 12, 2020
  25. apoelstra referenced this in commit e8f993cdc5 on Dec 3, 2020
  26. gwillen referenced this in commit 28c55d0a14 on Mar 23, 2021
  27. Fabcien referenced this in commit f2c2099544 on Dec 23, 2021
  28. bitcoin-core locked this on Feb 15, 2022


promag ryanofsky hebasto jonasschnelli


jonasschnelli

Milestone
0.21.0


github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin-core/gui. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-10-23 02:20 UTC

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