Skip to content

Commit 5826aff

Browse files
Switch semantic to include/not-include vs. cache/not-cache
Signed-off-by: Peter Broadhurst <peter.broadhurst@kaleido.io>
1 parent eeb5b99 commit 5826aff

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

pkg/ethblocklistener/blocklistener.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ type BlockListenerConfig struct {
4343
BlockPollingInterval time.Duration `json:"blockPollingInterval"`
4444
HederaCompatibilityMode bool `json:"hederaCompatibilityMode"`
4545
BlockCacheSize int `json:"blockCacheSize"`
46-
CacheLogsBloom bool `json:"cacheLogsBloom"`
46+
IncludeLogsBloom bool `json:"includeLogsBloom"`
4747
}
4848

4949
type BlockListener interface {

pkg/ethblocklistener/blocklistener_blockquery.go

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,6 @@ import (
3131
)
3232

3333
func (bl *blockListener) addToBlockCache(blockInfo *ethrpc.BlockInfoJSONRPC) {
34-
if !bl.CacheLogsBloom {
35-
blockInfo.LogsBloom = nil
36-
}
3734
bl.blockCache.Add(blockInfo.Hash.String(), blockInfo)
3835
bl.blockCache.Add(blockInfo.Number.BigInt().String(), blockInfo)
3936
}
@@ -94,6 +91,9 @@ func (bl *blockListener) GetBlockInfoByNumber(ctx context.Context, blockNumber u
9491
if blockInfo == nil {
9592
return nil, nil
9693
}
94+
if !bl.IncludeLogsBloom {
95+
blockInfo.LogsBloom = nil
96+
}
9797
bl.addToBlockCache(blockInfo)
9898
}
9999

@@ -116,6 +116,9 @@ func (bl *blockListener) GetBlockInfoByHash(ctx context.Context, hash0xString st
116116
}
117117
return nil, err
118118
}
119+
if !bl.IncludeLogsBloom {
120+
blockInfo.LogsBloom = nil
121+
}
119122
bl.addToBlockCache(blockInfo)
120123
}
121124

0 commit comments

Comments
 (0)