Move things in lightclient

This commit is contained in:
Ferran Borreguero 2021-12-22 12:10:32 +01:00
parent 1b9c2ad419
commit 71bb7157d0

View file

@ -49,17 +49,16 @@ var (
// headers, downloading block bodies and receipts on demand through an ODR // headers, downloading block bodies and receipts on demand through an ODR
// interface. It only does header validation during chain insertion. // interface. It only does header validation during chain insertion.
type LightChain struct { type LightChain struct {
hc *core.HeaderChain hc *core.HeaderChain
indexerConfig *IndexerConfig indexerConfig *IndexerConfig
chainDb ethdb.Database chainDb ethdb.Database
engine consensus.Engine engine consensus.Engine
odr OdrBackend odr OdrBackend
chainFeed event.Feed chainFeed event.Feed
chainSideFeed event.Feed chainSideFeed event.Feed
chainHeadFeed event.Feed chainHeadFeed event.Feed
chain2HeadFeed event.Feed scope event.SubscriptionScope
scope event.SubscriptionScope genesisBlock *types.Block
genesisBlock *types.Block
bodyCache *lru.Cache // Cache for the most recent block bodies bodyCache *lru.Cache // Cache for the most recent block bodies
bodyRLPCache *lru.Cache // Cache for the most recent block bodies in RLP encoded format bodyRLPCache *lru.Cache // Cache for the most recent block bodies in RLP encoded format
@ -73,6 +72,9 @@ type LightChain struct {
running int32 // whether LightChain is running or stopped running int32 // whether LightChain is running or stopped
procInterrupt int32 // interrupts chain insert procInterrupt int32 // interrupts chain insert
disableCheckFreq int32 // disables header verification disableCheckFreq int32 // disables header verification
// Bor
chain2HeadFeed event.Feed
} }
// NewLightChain returns a fully initialised light chain using information // NewLightChain returns a fully initialised light chain using information