Browse Source

Merge branch 'master' into thane/adr-protobuf-mgmt

pull/8029/head
Thane Thomson 3 years ago
committed by GitHub
parent
commit
f2f0cf26c8
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 5 deletions
  1. +2
    -1
      node/node.go
  2. +5
    -4
      node/setup.go

+ 2
- 1
node/node.go View File

@ -274,9 +274,10 @@ func makeNode(
return nil, combineCloseError(err, makeCloser(closers))
}
evReactor, evPool, err := createEvidenceReactor(ctx,
evReactor, evPool, edbCloser, err := createEvidenceReactor(ctx,
cfg, dbProvider, stateStore, blockStore, peerManager, router, logger, nodeMetrics.evidence, eventBus,
)
closers = append(closers, edbCloser)
if err != nil {
return nil, combineCloseError(err, makeCloser(closers))
}


+ 5
- 4
node/setup.go View File

@ -220,11 +220,12 @@ func createEvidenceReactor(
logger log.Logger,
metrics *evidence.Metrics,
eventBus *eventbus.EventBus,
) (*evidence.Reactor, *evidence.Pool, error) {
) (*evidence.Reactor, *evidence.Pool, closer, error) {
evidenceDB, err := dbProvider(&config.DBContext{ID: "evidence", Config: cfg})
if err != nil {
return nil, nil, fmt.Errorf("unable to initialize evidence db: %w", err)
return nil, nil, func() error { return nil }, fmt.Errorf("unable to initialize evidence db: %w", err)
}
dbCloser := evidenceDB.Close
logger = logger.With("module", "evidence")
@ -238,10 +239,10 @@ func createEvidenceReactor(
evidencePool,
)
if err != nil {
return nil, nil, fmt.Errorf("creating evidence reactor: %w", err)
return nil, nil, dbCloser, fmt.Errorf("creating evidence reactor: %w", err)
}
return evidenceReactor, evidencePool, nil
return evidenceReactor, evidencePool, dbCloser, nil
}
func createConsensusReactor(


Loading…
Cancel
Save