Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
gui: Fix race in WalletModel::pollBalanceChanged
Poll function was wrongly setting cached height to the current chain height instead of the chain height at the time of polling. This bug could cause balances to appear out of date, and was first introduced bitcoin@a0704a8#diff-2e3836af182cfb375329c3463ffd91f8L117. Before that commit, there wasn't a problem because cs_main was held during the poll update. Currently, the problem should be rare. But if 8937d99 from bitcoin#17954 were merged, the problem would get worse, because the wrong cachedNumBlocks value would be set if the wallet was polled in the interval between a block being connected and it processing the BlockConnected notification. Thanks to John Newbery <john@johnnewbery.com> for catching this while reviewing bitcoin#17954.
- Loading branch information