Skip to content

Commit c4098f8

Browse files
committed
problem: with recent Geth on PoS networks there is no Difficulty value for blocks
1 parent 8076c81 commit c4098f8

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/main/kotlin/io/emeraldpay/dshackle/data/BlockContainer.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ class BlockContainer(
4848
block.number,
4949
BlockId.from(block),
5050
block.parentHash?.let(BlockId.Companion::from),
51-
block.totalDifficulty,
51+
block.totalDifficulty ?: BigInteger.ZERO,
5252
block.timestamp,
5353
hasTransactions,
5454
raw,

src/main/kotlin/io/emeraldpay/dshackle/rpc/TrackEthereumTx.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ class TrackEthereumTx(
187187
}
188188

189189
fun setBlockDetails(tx: TxDetails, block: BlockJson<TransactionRefJson>): TxDetails {
190-
return if (block.number != null && block.totalDifficulty != null) {
190+
return if (block.number != null) {
191191
tx.withStatus(
192192
blockTotalDifficulty = block.totalDifficulty,
193193
blockTime = block.timestamp

0 commit comments

Comments
 (0)