Skip to content

Commit

Permalink
PM-3418: Quit traversing if descendant height is lower than ancestor …
Browse files Browse the repository at this point in the history
…height.
  • Loading branch information
aakoshh committed Jun 18, 2021
1 parent ef817cc commit 1cef0a1
Showing 1 changed file with 1 addition and 1 deletion.
Expand Up @@ -155,7 +155,7 @@ class BlockStorage[N, A <: Agreement: Block](
): KVStoreRead[N, List[A#Hash]] = {
if (blockHash == ancestorBlockHash) {
KVStoreRead[N].pure(blockHash :: acc)
} else if (maxDistance == 0) {
} else if (maxDistance <= 0) {
KVStoreRead[N].pure(Nil)
} else {
blockMetaColl.read(blockHash).flatMap {
Expand Down

0 comments on commit 1cef0a1

Please sign in to comment.