Co-authored-by: Facundo Medica <14063057+facundomedica@users.noreply.github.com> Co-authored-by: Julien Robert <julien@rbrt.fr>
This commit is contained in:
parent
6833172e75
commit
ce55ced719
@ -914,10 +914,10 @@ func (app *BaseApp) FinalizeBlock(req *abci.FinalizeBlockRequest) (res *abci.Fin
|
||||
func (app *BaseApp) checkHalt(height int64, time time.Time) error {
|
||||
var halt bool
|
||||
switch {
|
||||
case app.haltHeight > 0 && uint64(height) > app.haltHeight:
|
||||
case app.haltHeight > 0 && uint64(height) >= app.haltHeight:
|
||||
halt = true
|
||||
|
||||
case app.haltTime > 0 && time.Unix() > int64(app.haltTime):
|
||||
case app.haltTime > 0 && time.Unix() >= int64(app.haltTime):
|
||||
halt = true
|
||||
}
|
||||
|
||||
|
||||
@ -2021,9 +2021,11 @@ func TestABCI_HaltChain(t *testing.T) {
|
||||
expHalt bool
|
||||
}{
|
||||
{"default", 0, 0, 10, 0, false},
|
||||
{"halt-height-edge", 10, 0, 10, 0, false},
|
||||
{"halt-height", 10, 0, 11, 0, true},
|
||||
{"halt-time-edge", 0, 10, 1, 10, false},
|
||||
{"halt-height-edge", 11, 0, 10, 0, false},
|
||||
{"halt-height-equal", 10, 0, 10, 0, true},
|
||||
{"halt-height", 10, 0, 10, 0, true},
|
||||
{"halt-time-edge", 0, 11, 1, 10, false},
|
||||
{"halt-time-equal", 0, 10, 1, 10, true},
|
||||
{"halt-time", 0, 10, 1, 11, true},
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user