diff options
author | obscuren <geffobscura@gmail.com> | 2015-03-17 23:05:17 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2015-03-17 23:05:17 +0800 |
commit | c21293cd91f5cd95a823065eb2345c840feec1a0 (patch) | |
tree | 2ba865d420834d4dff1b43d27350b49544e1456a /core | |
parent | 0fa7859b94ddb0a35a6fbdb2c29139b0baaa2bfa (diff) | |
download | go-tangerine-c21293cd91f5cd95a823065eb2345c840feec1a0.tar.gz go-tangerine-c21293cd91f5cd95a823065eb2345c840feec1a0.tar.zst go-tangerine-c21293cd91f5cd95a823065eb2345c840feec1a0.zip |
bloom
Diffstat (limited to 'core')
-rw-r--r-- | core/types/bloom9.go | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/core/types/bloom9.go b/core/types/bloom9.go index 55bfe2756..59b6c69c3 100644 --- a/core/types/bloom9.go +++ b/core/types/bloom9.go @@ -28,7 +28,7 @@ func LogsBloom(logs state.Logs) *big.Int { } for _, b := range data { - bin.Or(bin, common.BigD(bloom9(crypto.Sha3(b[:])).Bytes())) + bin.Or(bin, bloom9(crypto.Sha3(b[:]))) } } @@ -38,9 +38,10 @@ func LogsBloom(logs state.Logs) *big.Int { func bloom9(b []byte) *big.Int { r := new(big.Int) - for i := 0; i < 16; i += 2 { + for i := 0; i < 6; i += 2 { t := big.NewInt(1) - b := uint(b[i+1]) + 1024*(uint(b[i])&1) + //b := uint(b[i+1]) + 512*(uint(b[i])&1) + b := (uint(b[i+1]) + (uint(b[i]) << 8)) & 511 r.Or(r, t.Lsh(t, b)) } |