diff options
author | obscuren <geffobscura@gmail.com> | 2015-04-29 20:00:24 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2015-04-29 20:00:24 +0800 |
commit | 735b029db95bf72c3105674c0f2b4f111e5ccdf5 (patch) | |
tree | d656426d54dbbdd2a187bf22e93ddc0ad9aaeece /cmd | |
parent | 764e81bf12bc45b00cec7db216e72d6396cf0c13 (diff) | |
download | go-tangerine-735b029db95bf72c3105674c0f2b4f111e5ccdf5.tar go-tangerine-735b029db95bf72c3105674c0f2b4f111e5ccdf5.tar.gz go-tangerine-735b029db95bf72c3105674c0f2b4f111e5ccdf5.tar.bz2 go-tangerine-735b029db95bf72c3105674c0f2b4f111e5ccdf5.tar.lz go-tangerine-735b029db95bf72c3105674c0f2b4f111e5ccdf5.tar.xz go-tangerine-735b029db95bf72c3105674c0f2b4f111e5ccdf5.tar.zst go-tangerine-735b029db95bf72c3105674c0f2b4f111e5ccdf5.zip |
core: return the index of the block that failed when inserting a chain
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/utils/cmd.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/cmd/utils/cmd.go b/cmd/utils/cmd.go index 64faf6ad1..cbb2d42aa 100644 --- a/cmd/utils/cmd.go +++ b/cmd/utils/cmd.go @@ -172,7 +172,7 @@ func ImportChain(chainmgr *core.ChainManager, fn string) error { n++ if n == batchSize { - if err := chainmgr.InsertChain(blocks); err != nil { + if _, err := chainmgr.InsertChain(blocks); err != nil { return fmt.Errorf("invalid block %v", err) } n = 0 @@ -181,7 +181,7 @@ func ImportChain(chainmgr *core.ChainManager, fn string) error { } if n > 0 { - if err := chainmgr.InsertChain(blocks[:n]); err != nil { + if _, err := chainmgr.InsertChain(blocks[:n]); err != nil { return fmt.Errorf("invalid block %v", err) } } |