From 6ff2c02991e60a8db54c2f60027442277fd889c0 Mon Sep 17 00:00:00 2001
From: Zsolt Felfoldi <zsfelfoldi@gmail.com>
Date: Wed, 6 Sep 2017 01:43:00 +0200
Subject: core/bloombits: AddBloom index parameter and fixes variable names

---
 eth/bloombits.go          | 2 +-
 eth/filters/bench_test.go | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

(limited to 'eth')

diff --git a/eth/bloombits.go b/eth/bloombits.go
index 02de408b0..32f6c7b31 100644
--- a/eth/bloombits.go
+++ b/eth/bloombits.go
@@ -122,7 +122,7 @@ func (b *BloomIndexer) Reset(section uint64) {
 // Process implements core.ChainIndexerBackend, adding a new header's bloom into
 // the index.
 func (b *BloomIndexer) Process(header *types.Header) {
-	b.gen.AddBloom(header.Bloom)
+	b.gen.AddBloom(uint(header.Number.Uint64()-b.section*b.size), header.Bloom)
 	b.head = header.Hash()
 }
 
diff --git a/eth/filters/bench_test.go b/eth/filters/bench_test.go
index d994378fc..abbf4593e 100644
--- a/eth/filters/bench_test.go
+++ b/eth/filters/bench_test.go
@@ -98,7 +98,7 @@ func benchmarkBloomBits(b *testing.B, sectionSize uint64) {
 			if header == nil {
 				b.Fatalf("Error creating bloomBits data")
 			}
-			bc.AddBloom(header.Bloom)
+			bc.AddBloom(uint(i-sectionIdx*sectionSize), header.Bloom)
 		}
 		sectionHead := core.GetCanonicalHash(db, (sectionIdx+1)*sectionSize-1)
 		for i := 0; i < types.BloomBitLength; i++ {
-- 
cgit v1.2.3