Bitcoin Forum

Bitcoin => Bitcoin Technical Support => Topic started by: valiopld on February 08, 2023, 09:25:40 AM



Title: Selected Wrong chaintip
Post by: valiopld on February 08, 2023, 09:25:40 AM
NOTE!! This Question and the results/test that are made was using litecoin node but I believe the technical part that causes "the problem" is the same as the Bitcoin Core

I have a Litecoin node (0.16.3) started on Testnet. Without any connection and addnode options started, When it got full synced as a last block its showing 2391641.
But with "getchaintips" rpc I am getting two different chaintips

Code:
[
  {
    "height": 2656160,
    "hash": "5b7ec12aa2c2e16028c0b6a85ec2b4644ab594b2d1aeaed4a2a596fae2173bc9",
    "branchlen": 395187,
    "status": "headers-only"
  },
  {
    "height": 2391641,
    "hash": "eaaf8d4d27c5ce9b282e9ff870793382e14345436fac74ea40907320e50603db",
    "branchlen": 0,
    "status": "active"
  }
]

My question is why the active chain is the chain with block 2391641 (second) instead of 2656160 (first).
My suggestions are something related to the core version and because mine version is old that is why I am connecting to this chain. Not sure about that.
With RPC "getpeerinfo" I am getting list of peers with different "startingheight" value (some of them 2656160 - and others 2391641).
The interesting is that
Code:
peers with "startingheight" - 2391641 have "version": 70015
peers with "startingheight" - 2656160 have "version" 70016

And Also what is the smartest way to make it connecting to the chain with tip 2656160 with some configurations or something else (accepting also changes in the core code) Thanks.


Title: Re: Selected Wrong chaintip
Post by: ABCbits on February 08, 2023, 10:24:19 AM
But with "getchaintips" rpc I am getting two different chaintips

This is expected behavior since Bitcoin Core doesn't purge orphan/stale block, even when it only store the header. On Bitcoin testnet, Bitcoin Core even show far more chaintips.

I have a Litecoin node (0.16.3) started on Testnet.

My question is why the active chain is the chain with block 2391641 (second) instead of 2656160 (first).

This shouldn't happen since various LTC testnet explorer show 26XXXXX as latest block height[1-2]. I'm not familiar with LTC, but release note[3] on newer Litecoin Core shows there are few consensus and P2P change. You might want to update your node to latest version and see whether the problem persists.

P.S. don't forget to backup to your wallet file and optionally whole LTC testnet blockchain.

[1] https://chain.so/testnet/ltc (https://chain.so/testnet/ltc)
[2] https://blockexplorer.one/litecoin/testnet (https://blockexplorer.one/litecoin/testnet)
[3] https://github.com/litecoin-project/litecoin/releases (https://github.com/litecoin-project/litecoin/releases)