From 7aa7490fb256d0469d7ed6d836ae33d6f1b68800 Mon Sep 17 00:00:00 2001 From: Roman Khimov Date: Thu, 26 Dec 2019 20:03:06 +0300 Subject: [PATCH] cli: fix wrong db dump format It was broken by 03ff2976ed6b6fa0a77646dcedbe5dd71c587860 that changed fixed 32-bit length encoding to VarBytes. --- cli/server/server.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cli/server/server.go b/cli/server/server.go index 965e3fb2a..314f08217 100644 --- a/cli/server/server.go +++ b/cli/server/server.go @@ -193,7 +193,8 @@ func dumpDB(ctx *cli.Context) error { buf := io.NewBufBinWriter() b.EncodeBinary(buf.BinWriter) bytes := buf.Bytes() - writer.WriteVarBytes(bytes) + writer.WriteU32LE(uint32(len(bytes))) + writer.WriteBytes(bytes) if writer.Err != nil { return cli.NewExitError(err, 1) }