Skip unparsed TransactionReceiptJson responses

This commit is contained in:
a10zn8
2022-12-10 20:39:13 +04:00
parent af69db7594
commit 117bd2d294

View File

@@ -117,7 +117,7 @@ class EthereumDirectReader(
val request = JsonRpcRequest("eth_getTransactionReceipt", listOf(key.toHex())) val request = JsonRpcRequest("eth_getTransactionReceipt", listOf(key.toHex()))
return readWithQuorum(request) return readWithQuorum(request)
.timeout(Defaults.timeoutInternal, Mono.error(TimeoutException("Receipt not read $key"))) .timeout(Defaults.timeoutInternal, Mono.error(TimeoutException("Receipt not read $key")))
.doOnNext { json -> .flatMap { json ->
try { try {
// Caching needs some additional data (ex. Height) to make a decision on how long and where to cache // Caching needs some additional data (ex. Height) to make a decision on how long and where to cache
// So we have to parse the JSON here and extract reference data // So we have to parse the JSON here and extract reference data
@@ -134,7 +134,9 @@ class EthereumDirectReader(
) )
} catch (t: Throwable) { } catch (t: Throwable) {
log.warn("Failed to cache Tx Receipt", t) log.warn("Failed to cache Tx Receipt", t)
return@flatMap Mono.empty()
} }
Mono.just(json)
} }
} }
} }