Skip to content

Commit

Permalink
rename func
Browse files Browse the repository at this point in the history
  • Loading branch information
srene committed Nov 8, 2024
1 parent 5c27a9d commit 45cdef5
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion block/fraud.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ type FreezeHandler struct {
}

func (f FreezeHandler) HandleFault(ctx context.Context, fault error) {
f.m.setNodeAsUnhealthy(ctx, fault)
f.m.freezeNode(ctx, fault)
}

func NewFreezeHandler(manager *Manager) *FreezeHandler {
Expand Down
2 changes: 1 addition & 1 deletion block/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ func (m *Manager) setFraudHandler(handler *FreezeHandler) {
m.FraudHandler = handler
}

func (m *Manager) setNodeAsUnhealthy(ctx context.Context, err error) {
func (m *Manager) freezeNode(ctx context.Context, err error) {
uevent.MustPublish(ctx, m.Pubsub, &events.DataHealthStatus{Error: err}, events.HealthStatusList)
m.unsubscribeFullNodeEvents(ctx)
}
2 changes: 1 addition & 1 deletion block/p2p.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ func (m *Manager) OnReceivedBlock(event pubsub.Message) {

err := m.attemptApplyCachedBlocks()
if err != nil {
m.setNodeAsUnhealthy(context.Background(), err)
m.freezeNode(context.Background(), err)
m.logger.Error("Attempt apply cached blocks.", "err", err)
}
}
Expand Down
4 changes: 2 additions & 2 deletions block/sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ func (m *Manager) SettlementSyncLoop(ctx context.Context) error {

err = m.ApplyBatchFromSL(settlementBatch.Batch)
if err != nil {
m.setNodeAsUnhealthy(context.Background(), err)
m.freezeNode(context.Background(), err)
m.logger.Error("process next DA batch", "err", err)
break
}
Expand All @@ -87,7 +87,7 @@ func (m *Manager) SettlementSyncLoop(ctx context.Context) error {

err = m.attemptApplyCachedBlocks()
if err != nil {
m.setNodeAsUnhealthy(context.Background(), err)
m.freezeNode(context.Background(), err)
m.logger.Error("Attempt apply cached blocks.", "err", err)
}

Expand Down

0 comments on commit 45cdef5

Please sign in to comment.