Don't stay connected to old-version peers #1633

pull gavinandresen wants to merge 1 commits into bitcoin:master from gavinandresen:testnet3ban changing 2 files +9 −0
  1. gavinandresen commented at 8:24 PM on July 26, 2012: contributor

    If running on the testnet, this disconnects and bans any peers that are running PROTOCOL_VERSION 60000 or earlier. This cuts way down on the number of peers that try to send you a testnet1 or 2 block chain.

    If PROCOTOL_VERSION is bumped before the 0.7 release, TESTNET3_VERSION should be increased to match.

  2. If -testnet, ban peers running old-non-testnet3-versions. 91159465a2
  3. gmaxwell commented at 8:26 PM on July 26, 2012: contributor

    Hm. Doesn't this break tools just as much as changing the magic would?

  4. gavinandresen commented at 8:40 PM on July 26, 2012: contributor

    Depends on the tool; tools that read blk*.dat will not break with this change, but do break changing the magic bytes.

    Network-speaking tools will have to be up-to-date with PROTOCOL_VERSION.

  5. gavinandresen commented at 8:42 PM on July 26, 2012: contributor

    PS: I don't want to spend a whole lot of time on this, because out-of-version testnet nodes is a problem that should eventually solve itself (people will eventually upgrade).

  6. jgarzik commented at 8:44 PM on July 26, 2012: contributor

    Frankly, I like changing the protocol magic more than adding a minimum-version.

    Changing the protocol magic (a) guarantees only compatible test clients communicate, while (b) leaving open the possibility that testnet3 may appear in a private backport or luke-jr's public backports.

    Setting a minimum protocol version is easy, but the issue we are trying to solve is -wholly unrelated to protocol versioning-. A version-3 client with the latest genesis block should be able to talk testnet3, for example.

  7. gavinandresen commented at 9:06 PM on July 26, 2012: contributor

    okey dokey.

    So.... we all have testnet3-with-existing-magic-bytes blk*.dat's on our hard disks. What's the migration plan if we change the magic bytes?

  8. gavinandresen commented at 10:14 PM on July 26, 2012: contributor

    changing magic bytes it is.

  9. gavinandresen closed this on Jul 26, 2012

  10. suprnurd referenced this in commit 825b3ccc97 on Dec 5, 2017
  11. DrahtBot locked this on Sep 8, 2021

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 15:16 UTC

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