From ae003a1578840c12378d72c2781a7f4c0a57c7d3 Mon Sep 17 00:00:00 2001 From: Roman Khimov Date: Fri, 27 Dec 2019 12:15:47 +0300 Subject: [PATCH] cli/server: fix db restorer math wrt skip Given `-s 1` with a dump of 6001 blocks it skipped the first one and then tried to import the next 6001 which failed with EOF because there are only 6000 blocks left. --- cli/server/server.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cli/server/server.go b/cli/server/server.go index 876d4b4aa..ae2288b01 100644 --- a/cli/server/server.go +++ b/cli/server/server.go @@ -242,7 +242,7 @@ func restoreDB(ctx *cli.Context) error { return cli.NewExitError(fmt.Errorf("input file has only %d blocks, can't read %d starting from %d", allBlocks, count, skip), 1) } if count == 0 { - count = allBlocks + count = allBlocks - skip } i := uint32(0) for ; i < skip; i++ {