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] Avoid second mapWallet lookup #2679

Merged

Conversation

random-zebra
Copy link

Completes the backport of bitcoin#11039 (which was partially done elsewhere)
Also extends it to pivx-specific code (sapling, budget).

All calls to mapWallet.count() have the intent to detect if a txid exists and most are followed by a second lookup to retrieve the CWalletTx.

This PR replaces all mapWallet.count() calls with mapWallet.find() to avoid the second lookup.

Copy link

@furszy furszy left a comment

Choose a reason for hiding this comment

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

ACK f46891a

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 f46891a

@random-zebra random-zebra merged commit 6a992f8 into PIVX-Project:master Dec 14, 2021
furszy added a commit that referenced this pull request Dec 16, 2021
4aa240c [Refactor] Avoid double lookups in sapling maps (random-zebra)

Pull request description:

  Based on top of
  - [x] #2679

  Does the same for other Sapling-related maps (`mapSaplingNoteData`, `mapSaplingNullifiersToNotes`).

ACKs for top commit:
  furszy:
    nice refactoring, ACK 4aa240c
  Fuzzbawls:
    ACK 4aa240c

Tree-SHA512: 8d787739b0b0b4558d8a0e310ee580ec0aa96f0bc765c8093ac823fcd154a2e9f920359bb01418c9348635f346a9df03b50fed1e976d825cc49fe4901a059f38
@Fuzzbawls Fuzzbawls modified the milestones: 6.0.0, 5.5.0 Sep 11, 2022
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