Skip to content

Commit 1d70ba5

Browse files
authored
Fix log warnings (== should have been !=) (#2907)
1 parent 1101895 commit 1d70ba5

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

nimbus/db/core_db/core_apps.nim

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ proc getUnclesCount*(
355355
let encodedUncles = block:
356356
let key = genericHashKey(ommersHash)
357357
db.ctx.getKvt().get(key.toOpenArray).valueOr:
358-
if error.error == KvtNotFound:
358+
if error.error != KvtNotFound:
359359
warn info, ommersHash, error=($$error)
360360
return ok(0)
361361
return ok(rlpFromBytes(encodedUncles).listLen)
@@ -372,7 +372,7 @@ proc getUncles*(
372372
let encodedUncles = block:
373373
let key = genericHashKey(ommersHash)
374374
db.ctx.getKvt().get(key.toOpenArray).valueOr:
375-
if error.error == KvtNotFound:
375+
if error.error != KvtNotFound:
376376
warn info, ommersHash, error=($$error)
377377
return ok(default(seq[Header]))
378378
return ok(rlp.decode(encodedUncles, seq[Header]))
@@ -474,7 +474,7 @@ proc getUncleHashes*(
474474
let
475475
key = genericHashKey(header.ommersHash)
476476
encodedUncles = db.ctx.getKvt().get(key.toOpenArray).valueOr:
477-
if error.error == KvtNotFound:
477+
if error.error != KvtNotFound:
478478
warn "getUncleHashes()", ommersHash=header.ommersHash, error=($$error)
479479
return ok(default(seq[Hash32]))
480480
return ok(rlp.decode(encodedUncles, seq[Header]).mapIt(it.rlpHash))
@@ -487,15 +487,16 @@ proc getTransactionKey*(
487487
let
488488
txKey = transactionHashToBlockKey(transactionHash)
489489
tx = db.ctx.getKvt().get(txKey.toOpenArray).valueOr:
490-
if error.error == KvtNotFound:
490+
if error.error != KvtNotFound:
491491
warn "getTransactionKey()", transactionHash, error=($$error)
492492
return ok(default(TransactionKey))
493493
return ok(rlp.decode(tx, TransactionKey))
494494

495495
proc headerExists*(db: CoreDbRef; blockHash: Hash32): bool =
496496
## Returns True if the header with the given block hash is in our DB.
497497
db.ctx.getKvt().hasKeyRc(genericHashKey(blockHash).toOpenArray).valueOr:
498-
warn "headerExists()", blockHash, error=($$error)
498+
if error.error != KvtNotFound:
499+
warn "headerExists()", blockHash, error=($$error)
499500
return false
500501
# => true/false
501502

0 commit comments

Comments
 (0)