Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge #2551: [BUG][GUI] Fix random double/triple transaction record i…
…ssue 7562b63 [BUG][GUI] Fix random double/triple transaction record issue (random-zebra) Pull request description: Should put the final nail in this coffin, allowing us to finally close #1480. This bug is caused by the fact that, if at startup the wallet has more than 4000 (`SINGLE_THREAD_MAX_TXES_SIZE`) transaction records, then chachedWallet is loaded not properly ordered, therfore the binary search (used later in `updateWallet`, to check whether a tx is already in the model) is unreliable. When the wallet has more than 4000 records, in fact, the list of records in `TransactionTablePriv::refreshWallet()` is split in batches, each one processed in a separate thread, processing the last batch in the main thread at the beginning, thus without preserving the original order (by hash) of `walletTxes`. Further, if the wallet has more than 200k records (`MAX_AMOUNT_LOADED_RECORDS`), then the list is also sorted by date before being trimmed and split in batches. Fix this by re-sorting the cachedWallet list by hash at the end of the multi-threaded update. ACKs for top commit: furszy: finally 🍺 , tested ACK 7562b63 Fuzzbawls: utACK 7562b63 Tree-SHA512: 8a3a26125cb1f8c70596c9bacfe52f7577edc810769ff53d48226533eda40fdc5aa4deab1e19ca7f84a4daebf000a959886547f285e65cbe4a3581aaff6a7dc9
- Loading branch information