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] Conflicted transactions external listeners notification fix #2241

Merged

Conversation

furszy
Copy link

@furszy furszy commented Mar 10, 2021

PR built on top of #2209, #2235 and #2240 (don't get scared by the amount of commits, most of them are coming from 2209. Will disappear as soon as that one gets merged).

Based on the brief talk originated in #2209 (comment) .

Solving the conflicted transactions external listeners notification. Adapting the following PRs: bitcoin#14384, bitcoin#17477 and bitcoin#18982. Without functional test support, for the time being, for the lack of RBF functionality.

@random-zebra
Copy link

Can be rebased now.

@furszy furszy force-pushed the 2020_conflicted_tx_notification_fix branch from a118a95 to f2ae007 Compare April 8, 2021 18:26
@furszy
Copy link
Author

furszy commented Apr 8, 2021

Took me a bit to rebase but done, so many changes included in master since i created this one.

@random-zebra
Copy link

There are two minor issues in the tests:

  • policyestimator needs the TestingSetup fixture (for the scheduler)
  • validation_block needs an updated BlockConnected (otherwise it won't override the base one).

random-zebra@9a8973d

@furszy
Copy link
Author

furszy commented Apr 9, 2021

commit cherry-picked 👍

random-zebra
random-zebra previously approved these changes Apr 9, 2021
Copy link

@random-zebra random-zebra left a comment

Choose a reason for hiding this comment

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

ACK 467888f

furszy and others added 10 commits April 13, 2021 12:38
…nsactionRemovedFromMempool callbacks from the mempool and cleans up a bunch of code.

Adaptation of btc@e20c72f9f076681def325b5b5fa53bccda2b0eab
The only CValidationInterface client that cares about transactions that
are removed from the mempool because of CONFLICT is the wallet.

Start using the TransactionRemovedFromMempool method to notify about
conflicted transactions instead of using the vtxConflicted vector in
BlockConnected.
The wallet now uses TransactionRemovedFromMempool to be notified about
conflicted wallet, and no other clients use vtxConflicted.

Adaptation of btc@cdb893443cc16edf974f099b8485e04b3db1b1d7
Since we don't add a vtxConflicted vector to BlockConnected the
conflictedTxs member of PerBlockConnectTrace is no longer used.
ConnectTrace used to subscribe to the mempool's NotifyEntryRemoved
callback to be notified of transactions removed for conflict. Since
PerBlockConnectTrace no longer tracks conflicted transactions,
ConnectTrace no longer requires these notifications
It's no longer used for anything.
NotifyEntryAdded never had any subscribers so can be removed.

Since ConnectTrace no longer subscribes to NotifyEntryRemoved, there are
now no subscribers.

The CValidationInterface TransactionAddedToMempool and
TransactionRemovedFromMempool methods can now provide this
functionality. There's no need for a special notifications framework for
the mempool.
@furszy
Copy link
Author

furszy commented Apr 13, 2021

Rebased on master, conflicts solved. Ready to go.

Copy link
Collaborator

@Fuzzbawls Fuzzbawls left a comment

Choose a reason for hiding this comment

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

ACK f2734f0

Copy link

@random-zebra random-zebra left a comment

Choose a reason for hiding this comment

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

re-utACK f2734f0 and merging...

@random-zebra random-zebra merged commit e0350ed into PIVX-Project:master Apr 14, 2021
@furszy furszy deleted the 2020_conflicted_tx_notification_fix branch November 29, 2022 14:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants