Skip to content

Commit fe72c5b

Browse files
Remove common.Config functions (#2328)
1 parent 585424e commit fe72c5b

File tree

3 files changed

+9
-10
lines changed

3 files changed

+9
-10
lines changed

snow/engine/common/config.go

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,6 @@ type Config struct {
3636
SharedCfg *SharedConfig
3737
}
3838

39-
func (c *Config) Context() *snow.ConsensusContext {
40-
return c.Ctx
41-
}
42-
43-
// IsBootstrapped returns true iff this chain is done bootstrapping
44-
func (c *Config) IsBootstrapped() bool {
45-
return c.Ctx.State.Get().State == snow.NormalOp
46-
}
47-
4839
// Shared among common.bootstrapper and snowman/avalanche bootstrapper
4940
type SharedConfig struct {
5041
// Tracks the last requestID that was used in a request

snow/engine/snowman/bootstrap/bootstrapper.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,10 @@ func New(config Config, onFinished func(ctx context.Context, lastReqID uint32) e
111111
return b, nil
112112
}
113113

114+
func (b *bootstrapper) Context() *snow.ConsensusContext {
115+
return b.Ctx
116+
}
117+
114118
func (b *bootstrapper) Start(ctx context.Context, startReqID uint32) error {
115119
b.Ctx.Log.Info("starting bootstrapper")
116120

@@ -556,7 +560,7 @@ func (b *bootstrapper) checkFinish(ctx context.Context) error {
556560
return nil
557561
}
558562

559-
if b.IsBootstrapped() || b.awaitingTimeout {
563+
if b.Ctx.State.Get().State == snow.NormalOp || b.awaitingTimeout {
560564
return nil
561565
}
562566

snow/engine/snowman/syncer/state_syncer.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,10 @@ func New(
108108
}
109109
}
110110

111+
func (ss *stateSyncer) Context() *snow.ConsensusContext {
112+
return ss.Ctx
113+
}
114+
111115
func (ss *stateSyncer) StateSummaryFrontier(ctx context.Context, nodeID ids.NodeID, requestID uint32, summaryBytes []byte) error {
112116
// ignores any late responses
113117
if requestID != ss.requestID {

0 commit comments

Comments
 (0)