I don't 100% understand what this condition implies.
What is interesting, is it is 1 coin at a time.
I forget which it is - does staking or mining reward 1 coin? I think it is mining. 1 coin per block.
So maybe he is mining so fast he is filling up his wallet / generating a lot of unnecessary traffic?
1 coin is current block reward on PoW, on PoS rewards in my wallet from 0.1 to 0.6, so a withdrawal of 1000 coins is a really heavy transaction, since it will have 1000 inputs or even more.
I looked the code and yes it seems that method writes to disk after every WalletUpdateSpent
It's probably worth checking if that bit of code is prevalent in other coins. I wonder why it writes to disk after each of them (maybe the double-spend protection that Currypto indicated?).
Perhaps there's some sort of hack or tweak that can be made with an "if" condition or a local counter/integer and a "while"... something to make it not write to disk for each of the coins (although if it's to counter double-spending perhaps that would screw the wallet up and its better to experiment with that in a siloed testnet type situation). It probably isn't such a factor for people that aren't running a server w/ a lot of processes going on simultaneously.