Co-authored-by: Facundo Medica <14063057+facundomedica@users.noreply.github.com> Co-authored-by: Facundo <facundomedica@gmail.com>
This commit is contained in:
co-authored by
Facundo Medica
Facundo
parent
2f49e9e120
commit
624fe4a027
+2
-2
@@ -896,10 +896,10 @@ func (app *BaseApp) FinalizeBlock(req *abci.RequestFinalizeBlock) (res *abci.Res
|
||||
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
|
||||
}
|
||||
|
||||
|
||||
@@ -1988,9 +1988,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},
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user