mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-19 02:12:23 +00:00
core: fix bloombits checking
This commit is contained in:
parent
b632f0be7a
commit
a327f36447
2 changed files with 3 additions and 3 deletions
|
|
@ -80,8 +80,8 @@ func (b *Generator) Bitset(idx uint) ([]byte, error) {
|
||||||
if b.nextBit != b.sections {
|
if b.nextBit != b.sections {
|
||||||
return nil, errors.New("bloom not fully generated yet")
|
return nil, errors.New("bloom not fully generated yet")
|
||||||
}
|
}
|
||||||
if idx >= b.sections {
|
if idx >= types.BloomBitLength {
|
||||||
return nil, errSectionOutOfBounds
|
return nil, errors.New("bloom bit out of bounds")
|
||||||
}
|
}
|
||||||
return b.blooms[idx], nil
|
return b.blooms[idx], nil
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -78,7 +78,7 @@ func testPutGet(db ethdb.Database, t *testing.T) {
|
||||||
|
|
||||||
_, err := db.Get([]byte("non-exist-key"))
|
_, err := db.Get([]byte("non-exist-key"))
|
||||||
if err == nil {
|
if err == nil {
|
||||||
t.Fatalf("expect to return a non found error")
|
t.Fatalf("expect to return a not found error")
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, v := range test_values {
|
for _, v := range test_values {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue