Open bitcoinbrisbane opened 4 years ago
Geez, where did that 4 years go! Need to get the pruneheight
on the rpc call and check.
Note, the pruneheight property doesnt seem to exist on the blockchaininfo class https://github.com/MetacoSA/NBitcoin/blob/master/NBitcoin/RPC/RPCClient.cs#L2545-L2582
async Task<SlimChainedBlock> SeemsStuck(CancellationToken cancellationToken)
{
if (State is not (BitcoinDWaiterState.NBXplorerSynching or BitcoinDWaiterState.Ready) ||
lastIndexedBlock is not { } lastBlock ||
GetConnectedClient() is not RPCClient rpc)
{
return null;
}
var blockchainInfo = await rpc.GetBlockchainInfoAsyncEx(cancellationToken);
return blockchainInfo.BestBlockHash != lastBlock.Hash ? lastBlock : null;
}
Needs this merged and released to Nuget https://github.com/MetacoSA/NBitcoin/pull/1214
If running a pruned node, and the last block stored on disk is lower than the setting
btc.startheight
, the index behaves strangely, as you would expect, but does not give the operator much indication as to what went wrong.One solution could be to:
getblockchaininfo
pruneheight
btc.startheight
I'll try make a PR for this soon. Just a reminder to myself. :)
Example json return object from
getblockchaininfo