This commit is contained in:
obscuren
2014-11-14 14:17:54 +01:00
parent 711be7009e
commit 56aa24002d
5 changed files with 20 additions and 21 deletions

View File

@ -8,16 +8,16 @@ import (
"github.com/ethereum/go-ethereum/state"
)
func CreateBloom(block *Block) []byte {
func CreateBloom(receipts Receipts) []byte {
bin := new(big.Int)
for _, receipt := range block.Receipts() {
bin.Or(bin, LogsBloom(receipt.logs))
for _, receipt := range receipts {
bin.Or(bin, logsBloom(receipt.logs))
}
return ethutil.LeftPadBytes(bin.Bytes(), 64)
}
func LogsBloom(logs state.Logs) *big.Int {
func logsBloom(logs state.Logs) *big.Int {
bin := new(big.Int)
for _, log := range logs {
data := [][]byte{log.Address}