From 5e15096da50af43016c1df8860112b493ece598f Mon Sep 17 00:00:00 2001 From: Termina1 Date: Sat, 3 Dec 2022 15:54:05 +0200 Subject: [PATCH] fix priority forkchoice, in case some nodes are faster than others --- .../kotlin/io/emeraldpay/dshackle/upstream/AbstractHead.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/kotlin/io/emeraldpay/dshackle/upstream/AbstractHead.kt b/src/main/kotlin/io/emeraldpay/dshackle/upstream/AbstractHead.kt index 6ee6c0b4..7c7bb5b9 100644 --- a/src/main/kotlin/io/emeraldpay/dshackle/upstream/AbstractHead.kt +++ b/src/main/kotlin/io/emeraldpay/dshackle/upstream/AbstractHead.kt @@ -73,10 +73,10 @@ abstract class AbstractHead @JvmOverloads constructor( completed = false } return source - .distinctUntilChanged { - it.hash + .filter { + log.debug("Filtering block $upstreamId block $it") + forkChoice.filter(it) } - .filter { forkChoice.filter(it) } .doFinally { // close internal stream if upstream is finished, otherwise it gets stuck, // but technically it should never happen during normal work, only when the Head