bitcoin-seeder icon indicating copy to clipboard operation
bitcoin-seeder copied to clipboard

Nodes the seeder is tracking may not always persist to disk due to races between ThreadDumper and ThreadCrawler

Open cculianu opened this issue 2 years ago • 0 comments

If ThreadDumper wakes up to save to disk periodically, it may miss nodes that are otherwise good and won't save them to disk. This is because it basically is getting nodes to save to disk from CAddrDb from its two lists: ourId and unkId.

However, when the crawler threads run, they "take" IPs to check from the CAddrDb class. These nodes are temporarily "popped" off the internal lists ourId and/or unkId (only to be returned later once a good/bad result is determined by the crawler).

So if ThreadDumper wakes up while any crawlers are actively checking nodes.. those nodes won't get saved to disk. :'(

cculianu avatar Mar 18 '24 23:03 cculianu