0.9.3 is advertising itself through addr messages before sync has completed. #4910

issue EddyMSilva opened this issue on September 14, 2014
  1. EddyMSilva commented at 6:39 AM on September 14, 2014: none

    I have a brand new setup with 0.9.3rc2 that has not finished syncing (~220k blocks so far) but which seems to have broadcast it's IPv4 and IPv6 addresses ahead of when it really should have. As far as I can understand from discussion on the forums the client is supposed to only do a self-announcement when it has completed at least the majority of the initial sync, but I started getting upwards of 50 incoming peers around height 100k. I've been able to reproduce this on a different server in a different rack. As of now I'm nearly maxed out with my peers and not even half way through the initial synchronization.

    The IP addresses in question have never had a node running on it before, so it's not as if these are peers with a stale cache trying to connect to a node they have heard about before.

  2. qubez commented at 1:45 PM on September 15, 2014: none

    Notabug. Bitcoin since 0.1.0 advertised itself when starting. It is good to be a well-connected peer early on to have many potential sources of blocks, and also to immediately be available to serve the blocks you have to others also getting caught up. Incoming transactions are also relayed and communicated to you when you are a full peer, even if they are not immediately spendable. Future improvements in blockchain downloading will only benefit from quick and early connections to the P2P network.

  3. laanwj commented at 1:56 PM on September 15, 2014: member

    Well there is logic to only advertise when the initial block download is finished:

    https://github.com/bitcoin/bitcoin/blob/master/src/main.cpp#L3507 https://github.com/bitcoin/bitcoin/blob/master/src/main.cpp#L4307

    Looking over the code the only use of GetLocalAddress that is not delimited by such a check is in AdvertizeLocal in net.cpp: https://github.com/bitcoin/bitcoin/blob/master/src/net.cpp#L216

  4. laanwj added the label P2P on Sep 15, 2014
  5. EddyMSilva commented at 2:38 PM on September 15, 2014: none

    It is good to be a well-connected peer early on to have many potential sources of blocks

    Blocks are only downloaded from a single peer, so this is meaningless. There's no selection criteria for the "best" syncnode, so more doesn't equate to "better".

    Well there is logic to only advertise when the initial block download is finished:

    Yes, which is why I was deeply confused that I got bombarded with peer requests from remote peers when I was so obviously not in sync. There's got to be some logic flaw in the client somewhere, there's no way external peers should have been finding me otherwise. I looked in blockchain.info's peer log and bitnodes.io's log and found that they had never connected to this IP address before, so it's unlikely that it ever existed before the time when I started the node there.

  6. Diapolo commented at 8:35 AM on September 16, 2014: none

    @laanwj So this is a bug then?

  7. laanwj commented at 8:45 AM on September 16, 2014: member

    @Diapolo In two cases there is a check for IsInitialBlockDownload before advertising, in the other case there is not. That looks like a bug/oversight. I'm not sure though.

  8. laanwj added the label Priority Low on Sep 16, 2014
  9. laanwj closed this on Feb 9, 2016

  10. MarcoFalke locked this on Sep 8, 2021
Labels

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-05-02 12:15 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me