Skip to content

Commit ccb4722

Browse files
committed
core/types: Changed bloom lookup to take anything bytes backed
1 parent d82aaf6 commit ccb4722

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

‎core/types/bloom9.go‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ import (
88
"github.com/ethereum/go-ethereum/crypto"
99
)
1010

11+
type bytesBacked interface {
12+
Bytes() []byte
13+
}
14+
1115
func CreateBloom(receipts Receipts) Bloom {
1216
bin := new(big.Int)
1317
for _, receipt := range receipts {
@@ -51,9 +55,9 @@ func bloom9(b []byte) *big.Int {
5155

5256
var Bloom9 = bloom9
5357

54-
func BloomLookup(bin Bloom, topic common.Hash) bool {
58+
func BloomLookup(bin Bloom, topic bytesBacked) bool {
5559
bloom := bin.Big()
56-
cmp := bloom9(topic[:])
60+
cmp := bloom9(topic.Bytes()[:])
5761

5862
return bloom.And(bloom, cmp).Cmp(cmp) == 0
5963
}

0 commit comments

Comments
 (0)