aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2015-04-15 17:58:45 +0800
committerobscuren <geffobscura@gmail.com>2015-04-15 17:58:45 +0800
commitccb4722a593aff7be5a2a5998534faf58a277139 (patch)
treea1641024d4a30d60ef1b26edf314410cceee3955
parentd82aaf617c8ec868446d8bd334d1e3dbc1475244 (diff)
downloadgo-tangerine-ccb4722a593aff7be5a2a5998534faf58a277139.tar
go-tangerine-ccb4722a593aff7be5a2a5998534faf58a277139.tar.gz
go-tangerine-ccb4722a593aff7be5a2a5998534faf58a277139.tar.bz2
go-tangerine-ccb4722a593aff7be5a2a5998534faf58a277139.tar.lz
go-tangerine-ccb4722a593aff7be5a2a5998534faf58a277139.tar.xz
go-tangerine-ccb4722a593aff7be5a2a5998534faf58a277139.tar.zst
go-tangerine-ccb4722a593aff7be5a2a5998534faf58a277139.zip
core/types: Changed bloom lookup to take anything bytes backed
-rw-r--r--core/types/bloom9.go8
1 files changed, 6 insertions, 2 deletions
diff --git a/core/types/bloom9.go b/core/types/bloom9.go
index 0d37cb19f..aa76a2e9d 100644
--- a/core/types/bloom9.go
+++ b/core/types/bloom9.go
@@ -8,6 +8,10 @@ import (
"github.com/ethereum/go-ethereum/crypto"
)
+type bytesBacked interface {
+ Bytes() []byte
+}
+
func CreateBloom(receipts Receipts) Bloom {
bin := new(big.Int)
for _, receipt := range receipts {
@@ -51,9 +55,9 @@ func bloom9(b []byte) *big.Int {
var Bloom9 = bloom9
-func BloomLookup(bin Bloom, topic common.Hash) bool {
+func BloomLookup(bin Bloom, topic bytesBacked) bool {
bloom := bin.Big()
- cmp := bloom9(topic[:])
+ cmp := bloom9(topic.Bytes()[:])
return bloom.And(bloom, cmp).Cmp(cmp) == 0
}