fix: nil ref on consensus halts for non-archive nodes

This commit is contained in:
Cassandra Heart 2025-10-09 22:45:07 -05:00
parent 3eb7477ff8
commit 30a76203d3
No known key found for this signature in database
GPG Key ID: 371083BFA6C240AA

View File

@ -202,11 +202,13 @@ func (e *GlobalConsensusEngine) eventDistributorLoop() {
if ok && data.Message != "" {
e.logger.Error(data.Message)
e.halt()
if err := e.stateMachine.Stop(); err != nil {
e.logger.Error(
"error occurred while halting consensus",
zap.Error(err),
)
if e.stateMachine != nil {
if err := e.stateMachine.Stop(); err != nil {
e.logger.Error(
"error occurred while halting consensus",
zap.Error(err),
)
}
}
go func() {
for {
@ -230,11 +232,13 @@ func (e *GlobalConsensusEngine) eventDistributorLoop() {
zap.Error(data.Error),
)
e.halt()
if err := e.stateMachine.Stop(); err != nil {
e.logger.Error(
"error occurred while halting consensus",
zap.Error(err),
)
if e.stateMachine != nil {
if err := e.stateMachine.Stop(); err != nil {
e.logger.Error(
"error occurred while halting consensus",
zap.Error(err),
)
}
}
go func() {
for {