Sync between two nodes #21266

issue liorko87 opened this issue on February 22, 2021
  1. liorko87 commented at 12:44 PM on February 22, 2021: none

    I'm using the latest release of bitcoin (0.21.0) with private blockchain. I have two nodes running on localhost When I'm generating a new block by using generatetoaddress I receivedthis error:

    error: Could not connect to the server 127.0.0.1:18001 (error code 0 - "timeout reached")
    
    Make sure the bitcoind server is running and that you are connecting to the correct RPC port.
    

    When I'm looking at the log, I see the same error as #12291:

    Timeout downloading headers from peer=1, disconnecting
    

    When I'm trying to mine a new block again, in some cases it's working and the block is created but not confirmed by the second node. The number of confirmations of the new block is 1.

    In all cases the second node does not see new blocks.

    EDIT: I checked the status of the rpc commands and it's still trying to create new blocks:

    "active_commands": [
        {
          "method": "generatetoaddress",
          "duration": 7371995894
        },
        {
          "method": "getrpcinfo",
          "duration": 18
        }
      ]
    
  2. liorko87 added the label Bug on Feb 22, 2021
  3. brunoerg commented at 10:51 AM on March 8, 2021: member

    What's your OS and configs?

  4. liorko87 commented at 11:09 AM on March 8, 2021: none

    Ubuntu 20.04.1 LTS

    EDIT: I'm adding my bitcoin.conf files:

    First file:

    
    testnet=1
    
    rpcauth=user:very_long_password
    server=1
    
    [main]
    
    [test]
    connect=127.0.0.1:17002
    rpcconnect=127.0.0.1
    port=17001
    rpcallowip=127.0.0.1
    rpcbind=127.0.0.1
    rpcport=18001
    listen=1
    txindex=0
    maxtxfee=0.02
    wallet=node1
    
    [regtest]
    
    

    Second File:

    testnet=1
    
    rpcauth=user:very_long_password
    server=1
    
    [main]
    
    [test]
    connect=127.0.0.1:17001
    rpcconnect=127.0.0.1
    port=17002
    rpcallowip=127.0.0.1
    rpcbind=127.0.0.1
    rpcport=18002
    listen=1
    txindex=0
    maxtxfee=0.02
    wallet=node2
    
    [regtest]
    
  5. liorko87 commented at 2:06 PM on March 10, 2021: none

    Here is another insight, I tried to generate 10 blocks on my testnet, during the run time of the command I received the same error as above, but I didn't shutdown my nodes. After few hours I looked at it and indeed 10 blocks created but can see by only the node that generate them.

  6. MarcoFalke commented at 4:11 PM on January 13, 2022: member

    I recommend regtest for private chains, not testnet3.

  7. MarcoFalke commented at 4:12 PM on January 13, 2022: member

    Is this still an issue with a recent version of Bitcoin Core? If yes, what are the steps to reproduce?

  8. MarcoFalke closed this on Jan 15, 2022

  9. DrahtBot locked this on Jan 15, 2023

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-04-25 15:15 UTC

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