Update price feeds if header changed by validator
- currently not validating price feeds if the underlying header already exists and is valid, since price feeds should have been added when initial header was added
This commit is contained in:
+1
-1
@@ -97,7 +97,7 @@ func lightSync() {
|
||||
|
||||
db := utils.LoadPostgres(databaseConfig, blockChain.Node())
|
||||
headerRepository := repositories.NewHeaderRepository(&db)
|
||||
validator := history.NewHeaderValidator(blockChain, headerRepository, validationWindow)
|
||||
validator := history.NewHeaderValidator(blockChain, headerRepository, validationWindow, []transformers.Transformer{})
|
||||
missingBlocksPopulated := make(chan int)
|
||||
go backFillAllHeaders(blockChain, headerRepository, missingBlocksPopulated, startingBlockNumber)
|
||||
|
||||
|
||||
@@ -89,14 +89,13 @@ func syncPriceFeeds() {
|
||||
|
||||
db := utils.LoadPostgres(databaseConfig, blockChain.Node())
|
||||
headerRepository := repositories.NewHeaderRepository(&db)
|
||||
// TODO: add transformers to validation so we don't miss events on new block headers
|
||||
validator := history.NewHeaderValidator(blockChain, headerRepository, validationWindow)
|
||||
missingBlocksPopulated := make(chan int)
|
||||
transformers := []transformers.Transformer{
|
||||
pep.NewPepTransformer(blockChain, &db),
|
||||
pip.NewPipTransformer(blockChain, &db),
|
||||
rep.NewRepTransformer(blockChain, &db),
|
||||
}
|
||||
validator := history.NewHeaderValidator(blockChain, headerRepository, validationWindow, transformers)
|
||||
go backFillPriceFeeds(blockChain, headerRepository, missingBlocksPopulated, startingBlockNumber, transformers)
|
||||
|
||||
for {
|
||||
|
||||
Reference in New Issue
Block a user