bitcoin/bitcoin — pull request #792 by gmaxwell (2012-02-01 23:23:17+00:00)
Title: Avoid advertising the node's address when it is not listening or IsInitialBlockDownload().

This also avoids flushing setAddrKnown until 24 hours has passed,
and avoids contacting the external IP services when not listening.

Advertising non-listening nodes is just addr message spam.
It doesn't help the network, in fact it hurts the network,
and it also hurts user's privacy.

Advertising far out of sync nodes doesn't help the network—
they can't even forward (most) transactions and wastes nodes
outbound slots.