Request 1 block above our chain height

This commit is contained in:
Manfred Karrer 2019-04-17 18:40:31 -05:00
parent 7df35f3ce8
commit da10470dc5
No known key found for this signature in database
GPG Key ID: 401250966A6B2C46

View File

@ -103,11 +103,12 @@ public class LiteNode extends BsqNode {
// We expect to receive the new BSQ block from the network shortly after BitcoinJ has been aware of it.
// If we don't receive it we request it manually from seed nodes
checkForBlockReceivedTimer = UserThread.runAfter(() -> {
if (daoStateService.getChainHeight() < height) {
int chainHeight = daoStateService.getChainHeight();
if (chainHeight < height) {
log.warn("We did not receive a block from the network {} seconds after we saw the new block in BicoinJ. " +
"We request from our seed nodes missing blocks from block height {}.",
CHECK_FOR_BLOCK_RECEIVED_DELAY_SEC, daoStateService.getChainHeight());
liteNodeNetworkService.requestBlocks(daoStateService.getChainHeight());
CHECK_FOR_BLOCK_RECEIVED_DELAY_SEC, chainHeight + 1);
liteNodeNetworkService.requestBlocks(chainHeight + 1);
}
}, CHECK_FOR_BLOCK_RECEIVED_DELAY_SEC);
});