Skip to content

Conversation

@cozz
Copy link
Contributor

@cozz cozz commented Aug 17, 2014

checkBalanceChanged() is quite expensive on larger wallets as we loop mapWallet
several times for each balance-type.

There already is a periodical function pollBalanceChanged().
So instead of calling checkBalanceChanged() for each updated transaction, set a flag
fForceCheckBalanceChanged, which forces pollBalanceChanged() to check the balance
on the next run.

For example
importaddress mvqaxopu9Uef2qjXSV3fGrp6DcEYnCoYWK
adds like 20000 transactions to the wallet.
This means after rescan currently we loop mapWallet 120000 times,
just to check the balance, which causes 100% cpu for a while.

Unrelated change: Move showProgress signal after the QueueProcessing, so that the progressbar is still shown, while the 20000 txs get added to the GUI.

@laanwj laanwj added the Wallet label Aug 18, 2014
@laanwj
Copy link
Member

laanwj commented Aug 18, 2014

Untested ACK

@BitcoinPullTester
Copy link

Automatic sanity-testing: PASSED, see http://jenkins.bluematt.me/pull-tester/p4712_80daee0fb585762d303503f32f8efa0e625f152f/ for binaries and test log.
This test script verifies pulls every time they are updated. It, however, dies sometimes and fails to test properly. If you are waiting on a test, please check timestamps to verify that the test.log is moving at http://jenkins.bluematt.me/pull-tester/current/
Contact BlueMatt on freenode if something looks broken.

@dgenr8
Copy link
Contributor

dgenr8 commented Sep 5, 2014

Untested ACK

@laanwj laanwj merged commit 80daee0 into bitcoin:master Sep 8, 2014
laanwj added a commit that referenced this pull request Sep 8, 2014
80daee0 [Qt] Call checkBalanceChanged() periodically instead for every updated transaction (Cozz Lovan)
wtogami pushed a commit to litecoin-project/bitcoinomg that referenced this pull request Sep 9, 2014
…d transaction

Rebased-from: 80daee0fb585762d303503f32f8efa0e625f152f
bitcoin/bitcoin#4712
wtogami pushed a commit to litecoin-project/litecoin that referenced this pull request Sep 19, 2014
wtogami pushed a commit to litecoin-project/litecoin that referenced this pull request Oct 2, 2014
wtogami pushed a commit to litecoin-project/litecoin that referenced this pull request Nov 14, 2014
wtogami pushed a commit to litecoin-project/litecoin that referenced this pull request Dec 23, 2014
@cozz cozz mentioned this pull request Feb 20, 2015
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Sep 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants