You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Merge #6875: feat: share vecMasternodesUsed across all wallets, improve its handling
eb3be09 refactor: code style/log text adjustments (UdjinM6)
f50d09a fix: update `MasternodeMetaStore::ToString()` (UdjinM6)
13a28fa perf: optimize CoinJoin masternode tracking with hybrid data structure (UdjinM6)
2c82532 feat: share `vecMasternodesUsed` across all wallets, improve its handling (UdjinM6)
Pull request description:
## Issue being fixed or feature implemented
`vecMasternodesUsed` has a few issues:
- it's shared only across mixing sessions in a single wallet, wallets don't share this data so it's possible they are going to waste tries in `StartNewQueue()` and fail to start mixing because of that
- we start with a fresh vector each time which also can result in failed mixing attempts
- there are two threads (scheduler and net) where it can be accessed but it's not protected by any mutex atm
- it still stores masternode outpoints while most of our codebase uses protxhash-es as masternode ids
## What was done?
- moved it to `MasternodeMetaStore` and renamed it to `m_used_masternodes`
- changed to `std::vector<uint256>` (using `proTxHash` now)
- implemented proper encapsulation through accessor methods
- `m_used_masternodes` is no longer accessed via multiple threads (because it's not cleared in `ResetPool()`) but I made it thread-safe anyway just in case (using existing `Mutex cs`)
- made it persistent via serialization (with version bump 4 -> 5)
## How Has This Been Tested?
Mixing in multiple wallets at once
## Breaking Changes
n/a
## Checklist:
- [ ] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have added or updated relevant unit/integration/functional/e2e tests
- [ ] I have made corresponding changes to the documentation
- [ ] I have assigned this pull request to a milestone _(for repository code-owners and collaborators only)_
ACKs for top commit:
knst:
utACK eb3be09
kwvg:
utACK eb3be09
Tree-SHA512: 68527f4edb255baf879055d622d72e3aff9807ee37c59dca3b7f4436df8bba67fddba9331b5d8af50ca849fdcfbb57ef003bf093856fc1ba210d43deecd8048c
0 commit comments