Skip to content

IBD stalls if addnode peer is in IBD #34096

Open

Description

@davidgumberg

Starting with two fresh nodes A and B: If you start node A and (before node A completes IBD) start a second node B with -addnode={address of node A}, node B will stall and not proceed in IBD.

mkdir -p /tmp/nodea /tmp/nodeb

cat > /tmp/nodea/bitcoin.conf << EOF
prune=1000
bind=127.0.0.1:8333
EOF

cat > /tmp/nodeb/bitcoin.conf << EOF
prune=1000
rpcport=18331
bind=127.0.0.1:18335
addnode=127.0.0.1:8333
EOF

and then start both nodes however you prefer, e.g.

bitcoind -datadir=/tmp/nodea --daemonwait
bitcoind -datadir=/tmp/nodeb --daemonwait

And node B will not advance:

tail /tmp/nodeb/debug.log

Shutdown node A and node B comes to life!:

bitcoin-cli -datadir=/tmp/nodea stop
tail /tmp/nodeb/debug.log

Activity

  1. mzumsande commented on Sep 18, 2026

    @mzumsande
    Contributor

    I don't think that this is a permanent stall - just a delay. If we have other peers, I would expect us to sync headers with them after 1) a new block is found and INVed to us by some peer or 2) m_headers_sync_timeout is reached - whichever comes first.

    In case 2), we would sync headers with a new peer - which may or may not be the old peer, this is depending on the order in which peers are processed by net, see https://github.com/bitcoin/bitcoin/blob/master/src/net_processing.cpp#L6492-L6500.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions