[Bug] wallet update states and subscribes to a HUGE number of already spent coins on restart

Author: iliasorazovCreated Dec 7, 2023Updated Aug 21, 2026
Labelsbug

What happened?

The wallet is very active but only has 2-6 unspent coins now.

The restart takes ~20 minutes and there are following lines in the log:

INFO Successfully subscribed and updated 852 puzzle hashes INFO new coin state received (1-900/ 1000) INFO new coin state received (901-1000/ 1000) <skipped 226 lines> INFO new coin state received (1-900/ 1000) INFO new coin state received (901-1000/ 1000) INFO new coin state received (1-556/ 556) INFO Successfully subscribed and updated 115556 coin ids

It seams that coins comes from the interested_coins table which has 115556 records now and there is only one place in the code where these coins are removed: https://github.com/Chia-Network/chia-blockchain/blob/6c8259cb4bd88fb21b1cff12a7677f0609df0069/chia/wallet/wallet_state_manager.py#L1842-L1843

But what about normal coins? What about rewards? Why the wallet is interested in already spent coins and takes forever to restart? This doesn't seems right.

Any suggestions?

Version

2.1.1

What platform are you using?

Linux

What ui mode are you using?

CLI

Relevant log output

No response

Source: Chia-Network/chia-blockchain