@@ -355,7 +355,7 @@ proc getUnclesCount*(
355
355
let encodedUncles = block :
356
356
let key = genericHashKey(ommersHash)
357
357
db.ctx.getKvt().get(key.toOpenArray).valueOr:
358
- if error.error = = KvtNotFound:
358
+ if error.error ! = KvtNotFound:
359
359
warn info, ommersHash, error= ($$ error)
360
360
return ok(0 )
361
361
return ok(rlpFromBytes(encodedUncles).listLen)
@@ -372,7 +372,7 @@ proc getUncles*(
372
372
let encodedUncles = block :
373
373
let key = genericHashKey(ommersHash)
374
374
db.ctx.getKvt().get(key.toOpenArray).valueOr:
375
- if error.error = = KvtNotFound:
375
+ if error.error ! = KvtNotFound:
376
376
warn info, ommersHash, error= ($$ error)
377
377
return ok(default(seq [Header]))
378
378
return ok(rlp.decode(encodedUncles, seq [Header]))
@@ -474,7 +474,7 @@ proc getUncleHashes*(
474
474
let
475
475
key = genericHashKey(header.ommersHash)
476
476
encodedUncles = db.ctx.getKvt().get(key.toOpenArray).valueOr:
477
- if error.error = = KvtNotFound:
477
+ if error.error ! = KvtNotFound:
478
478
warn " getUncleHashes()" , ommersHash= header.ommersHash, error= ($$ error)
479
479
return ok(default(seq [Hash32]))
480
480
return ok(rlp.decode(encodedUncles, seq [Header]) .mapIt(it.rlpHash))
@@ -487,15 +487,16 @@ proc getTransactionKey*(
487
487
let
488
488
txKey = transactionHashToBlockKey(transactionHash)
489
489
tx = db.ctx.getKvt().get(txKey.toOpenArray).valueOr:
490
- if error.error = = KvtNotFound:
490
+ if error.error ! = KvtNotFound:
491
491
warn " getTransactionKey()" , transactionHash, error= ($$ error)
492
492
return ok(default(TransactionKey))
493
493
return ok(rlp.decode(tx, TransactionKey))
494
494
495
495
proc headerExists* (db: CoreDbRef; blockHash: Hash32): bool =
496
496
# # Returns True if the header with the given block hash is in our DB.
497
497
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)
499
500
return false
500
501
# => true/false
501
502
0 commit comments