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

[BUG] Fix crash when sending shield notes from the GUI with coin control #2327

Merged
merged 5 commits into from
Apr 23, 2021

Conversation

random-zebra
Copy link

This particular flow calls SaplingScriptPubKeyMan::GetNotes (instead of GetFilteredNotes), which calls CWalletTx::GetDepthInMainChain without holding cs_wallet (requirement introduced via AssertLockHeld in 1386ab7).

Add a simple unittest to cover GetNotes/GetFilteredNotes, do a bit of refactoring (removing some code duplication), and fix the missing lock.

@random-zebra random-zebra added Bug Wallet Tests Needs Backport Placeholder tag for anything needing a backport to prior version branches Sapling labels Apr 21, 2021
@random-zebra random-zebra added this to the 5.1.0 milestone Apr 21, 2021
@random-zebra random-zebra self-assigned this Apr 21, 2021
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.

Nice PR 👌👌. Great stuff with the test case, crash fix and further code unification.

ACK dcc0166 .

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 dcc0166

@random-zebra random-zebra merged commit d38a486 into PIVX-Project:master Apr 23, 2021
Fuzzbawls added a commit that referenced this pull request Apr 24, 2021
68b91b1 [Refactoring] Don't compute depth multiple times in GetFilteredNotes (random-zebra)
9bec9bc [BUG] Missing cs_wallet lock in SaplingScriptPubKeyMan::GetNotes (random-zebra)
b2d9061 [Trivial] Pass big args by const-reference for notes decryption (random-zebra)
7d75415 [Refactoring] Use CWalletTx::DecryptSaplingNote in Get[Filtered]Notes (random-zebra)
310db82 [Tests] Add basic unit-test for SaplingScriptPubKeyMan::GetNotes (random-zebra)
1886dda [GUI] Fix Cold Staking address list (Fuzzbawls)

Pull request description:

  Backport the following bug fixes PRs to the 5.1 branch:

  #2321
  #2327

  After having this one and #2333 merged, we are good to go with the final v5.1.0 production release.

ACKs for top commit:
  random-zebra:
    utACK 68b91b1
  Fuzzbawls:
    utACK 68b91b1

Tree-SHA512: 794e0845c27e9fc976fdf18fc0d6baceb6867aab89ab58100119b909b908763eeb0af6a4ef6f3befcf4dc2f13b885bab1c66639bd7e3e7153eefee8969c3e50d
@random-zebra random-zebra removed the Needs Backport Placeholder tag for anything needing a backport to prior version branches label Aug 27, 2021
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.

3 participants