diff options
author | Felix Lange <fjl@twurst.com> | 2015-03-17 19:01:40 +0800 |
---|---|---|
committer | Felix Lange <fjl@twurst.com> | 2015-03-17 19:01:40 +0800 |
commit | ee7202fa00198abaa423a1483468ca979ac9f3f4 (patch) | |
tree | 0f332b84b73997aca73b4d508ab7e8ccf9687bcf /core/types | |
parent | 65eee2006d649b2b4f4fef9332d339444bb479b1 (diff) | |
parent | 515d9432fcef8c574627049d437d6898b56c2829 (diff) | |
download | dexon-ee7202fa00198abaa423a1483468ca979ac9f3f4.tar dexon-ee7202fa00198abaa423a1483468ca979ac9f3f4.tar.gz dexon-ee7202fa00198abaa423a1483468ca979ac9f3f4.tar.bz2 dexon-ee7202fa00198abaa423a1483468ca979ac9f3f4.tar.lz dexon-ee7202fa00198abaa423a1483468ca979ac9f3f4.tar.xz dexon-ee7202fa00198abaa423a1483468ca979ac9f3f4.tar.zst dexon-ee7202fa00198abaa423a1483468ca979ac9f3f4.zip |
Merge remote-tracking branch 'ethereum/conversion' into conversion
Diffstat (limited to 'core/types')
-rw-r--r-- | core/types/bloom9.go | 6 | ||||
-rw-r--r-- | core/types/common.go | 10 |
2 files changed, 12 insertions, 4 deletions
diff --git a/core/types/bloom9.go b/core/types/bloom9.go index b3cab86a0..55bfe2756 100644 --- a/core/types/bloom9.go +++ b/core/types/bloom9.go @@ -47,9 +47,9 @@ func bloom9(b []byte) *big.Int { return r } -func BloomLookup(bin, topic []byte) bool { - bloom := common.BigD(bin) - cmp := bloom9(crypto.Sha3(topic)) +func BloomLookup(bin Bloom, topic common.Hash) bool { + bloom := bin.Big() + cmp := bloom9(crypto.Sha3(topic[:])) return bloom.And(bloom, cmp).Cmp(cmp) == 0 } diff --git a/core/types/common.go b/core/types/common.go index dd5dc00c8..6c5ac06b1 100644 --- a/core/types/common.go +++ b/core/types/common.go @@ -1,6 +1,10 @@ package types -import "math/big" +import ( + "math/big" + + "github.com/ethereum/go-ethereum/common" +) type BlockProcessor interface { Process(*Block) (*big.Int, error) @@ -24,3 +28,7 @@ func (b *Bloom) SetBytes(d []byte) { b[i] = b[i] } } + +func (b Bloom) Big() *big.Int { + return common.Bytes2Big(b[:]) +} |