When an IP address in *new* table is overwritten?

When an IP address in *new* table is overwritten?

I'm reading the address management of Bitcoin core implementation. There is one thing I couldn't understand is in which condition an IP address in the new table of a node is overwritten?

In particular, when the node hears about a new peer, it adds that IP address into a slot in the new table, if that slot is occupied, it checks if the existing isTerrible: https://github.com/bitcoin/bitcoin/blob/master/src/addrman.cpp#L309

if (infoExisting.IsTerrible() || (infoExisting.nRefCount > 1 && pinfo->nRefCount == 0))

What is nRefCount? What is the idea behind this check?

https://ift.tt/2Q5YSK8

Comments

Popular posts from this blog

bitcoin node: what is the difference between simnet and regtest?

How to check if Electrum is masking my IP with the Tor proxy?

Need help to recover blpckchain.info wallet, my wife forgot her password and the brute force with btcrecover is not catching the password