Bloom expanded by 4

This commit is contained in:
obscuren 2015-03-03 11:56:12 +01:00
parent fa910966ed
commit 34ee5ab9a8
1 changed files with 4 additions and 3 deletions

View File

@ -14,7 +14,7 @@ func CreateBloom(receipts Receipts) []byte {
bin.Or(bin, LogsBloom(receipt.logs)) bin.Or(bin, LogsBloom(receipt.logs))
} }
return ethutil.LeftPadBytes(bin.Bytes(), 64) return ethutil.LeftPadBytes(bin.Bytes(), 256)
} }
func LogsBloom(logs state.Logs) *big.Int { func LogsBloom(logs state.Logs) *big.Int {
@ -37,9 +37,10 @@ func LogsBloom(logs state.Logs) *big.Int {
func bloom9(b []byte) *big.Int { func bloom9(b []byte) *big.Int {
r := new(big.Int) r := new(big.Int)
for _, i := range []int{0, 2, 4} {
for i := 0; i < 16; i += 2 {
t := big.NewInt(1) t := big.NewInt(1)
b := uint(b[i+1]) + 256*(uint(b[i])&1) b := uint(b[i+1]) + 1024*(uint(b[i])&1)
r.Or(r, t.Lsh(t, b)) r.Or(r, t.Lsh(t, b))
} }