forked from dashpay/dash
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge dashpay#6536: refactor: consolidate ProTx wallet UTXO locking l…
…ogic 0efc9bb wallet: extract ProTx UTXO locking into `LockProTxCoins` (Kittywhiskers Van Gogh) 4e81799 wallet: extract adding UTXOs from CTransaction into `AddWalletUTXOs` (Kittywhiskers Van Gogh) 626bc61 wallet: clean up `ListLockedCoins()` implementation (Kittywhiskers Van Gogh) 8ba0f27 wallet: split off `ListProTxCoins` to allow supplying your own set (Kittywhiskers Van Gogh) Pull request description: ## Additional Information * This pull request consolidates locking ProTx UTXOs in a wallet by splitting them into three steps * Scanning transactions for eligible UTXOs and registering them in the wallet UTXO set (`AddWalletUTXOs()`) * Going through a UTXO set and finding ProTx transactions (modified `ListProTxCoins()` to accept supplied sets) * Locking all supplied ProTx UTXOs (folded into `LockProTxCoins()`, which utilizes the previous two steps) * These are the behavior changes expected from this PR: * `AutoLockMasternodeCollaterals()` will now add new UTXOs it finds to the wallet UTXO set (`setWalletUTXO`) (earlier behavior was to only scan and lock). * UTXO locks will be consistently stored on disk (persistent locks were introduced in [bitcoin#23065](bitcoin#23065) ([dash#6530](dashpay#6530)) but weren't consistently used in all applicable `LockCoin()` calls) * The `m_chain` checks removed from various sections are acceptable as the check is still present in `ListProTxCoins()` ([source](https://github.com/dashpay/dash/blob/f1c583a92a9060f800c500b80847fc9a5f216be5/src/wallet/wallet.cpp#L4502-L4505)) and it will clear the vector if it fails, which will effectively skip subsequent logic (also because it's the only place where `listMNCollaterials` is called) * Though this does not prevent them from being added to the wallet UTXO set as this happens _before_ `ListProTxCoins()` is called but this isn't undesirable. ## Breaking Changes None expected. ## Checklist - [x] I have performed a self-review of my own code - [x] I have commented my code, particularly in hard-to-understand areas - [x] I have added or updated relevant unit/integration/functional/e2e tests **(note: N/A)** - [x] I have made corresponding changes to the documentation **(note: N/A)** - [x] I have assigned this pull request to a milestone _(for repository code-owners and collaborators only)_ ACKs for top commit: UdjinM6: utACK 0efc9bb Tree-SHA512: f292c3510dad4a1c9a16309b64bb1147dfa3c7cc3200ed7698ef902b2c8cc3372464bc68811718eab36b21c8759f552bc894b315da9e2188eb8928a38f92c7ab
- Loading branch information
Showing
10 changed files
with
73 additions
and
92 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters