Fix state for 0x0 block (#412)

This commit is contained in:
KirillPamPam
2024-02-01 18:01:15 +04:00
committed by GitHub
parent ac5b44332b
commit 46bb122f1b
2 changed files with 4 additions and 1 deletions

View File

@@ -27,7 +27,7 @@ abstract class RecursiveLowerBoundBlockDetector(
} else {
val middle = middleBlock(data)
if (data.left > data.right || middle == 0L) {
if (data.left > data.right) {
val current = if (data.current == 0L) 1 else data.current
Mono.just(LowerBoundData(current, true))
} else {

View File

@@ -40,6 +40,9 @@ class EthereumLowerBoundBlockDetector(
}
override fun hasState(blockNumber: Long): Mono<Boolean> {
if (blockNumber == 0L) {
return Mono.just(true)
}
return upstream.getIngressReader().read(
JsonRpcRequest(
"eth_getBalance",