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

Introduce IsUsed in the CoinsRegistry #11580

Merged
merged 1 commit into from
Sep 25, 2023

Conversation

turbolay
Copy link
Collaborator

Found while looking at #11577 (comment)

This PR has 2 goals:

  • On master, CanBeConsideredDustAttack enumerates all the time the Coins of the wallet. This PR uses the TryGetValue of CoinsByPubKeys, a cache that was introduced in CoinsRegistry: Introduce CoinsByPubKeys #11571. So it's cleaner and potentially more performant in some cases.
  • On master, CanBeConsideredDustAttack has a bug; it doesn't consider the keys with no unspent coin left to unlock as used. This PR fixes this.

Note: Maybe it would make more sense to do this using the KeyManager, but CanBeConsideredDustAttack was already using the CoinsRegistry.

Copy link
Collaborator

@lontivero lontivero left a comment

Choose a reason for hiding this comment

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

LGTM

@lontivero lontivero merged commit c2774d2 into WalletWasabi:master Sep 25, 2023
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants