Skip to content

Commit

Permalink
go/abci/mux: log error if GetEpoch fails
Browse files Browse the repository at this point in the history
  • Loading branch information
ptrus committed Mar 16, 2021
1 parent 7a79233 commit ef709e4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions go/consensus/tendermint/abci/mux.go
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ func (mux *abciMux) BeginBlock(req types.RequestBeginBlock) types.ResponseBeginB

currentEpoch, err := mux.state.GetCurrentEpoch(ctx)
if err != nil {
panic(fmt.Errorf("mux: can't get current epoch in BeginBlock"))
panic(fmt.Errorf("mux: can't get current epoch in BeginBlock: %w", err))
}

// Check if there are any upgrades pending or if we need to halt for an upgrade. Note that these
Expand Down Expand Up @@ -753,7 +753,7 @@ func (mux *abciMux) EndBlock(req types.RequestEndBlock) types.ResponseEndBlock {
if upgrader := mux.state.Upgrader(); upgrader != nil {
currentEpoch, err := mux.state.GetCurrentEpoch(ctx)
if err != nil {
panic(fmt.Errorf("mux: can't get current epoch in BeginBlock"))
panic(fmt.Errorf("mux: can't get current epoch in BeginBlock: %w", err))
}

err = upgrader.ConsensusUpgrade(ctx, currentEpoch, ctx.BlockHeight())
Expand Down

0 comments on commit ef709e4

Please sign in to comment.