aboutsummaryrefslogtreecommitdiffstats
path: root/cmd/utils/cmd.go
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2015-04-29 20:00:24 +0800
committerobscuren <geffobscura@gmail.com>2015-04-29 20:00:24 +0800
commit735b029db95bf72c3105674c0f2b4f111e5ccdf5 (patch)
treed656426d54dbbdd2a187bf22e93ddc0ad9aaeece /cmd/utils/cmd.go
parent764e81bf12bc45b00cec7db216e72d6396cf0c13 (diff)
downloaddexon-735b029db95bf72c3105674c0f2b4f111e5ccdf5.tar
dexon-735b029db95bf72c3105674c0f2b4f111e5ccdf5.tar.gz
dexon-735b029db95bf72c3105674c0f2b4f111e5ccdf5.tar.bz2
dexon-735b029db95bf72c3105674c0f2b4f111e5ccdf5.tar.lz
dexon-735b029db95bf72c3105674c0f2b4f111e5ccdf5.tar.xz
dexon-735b029db95bf72c3105674c0f2b4f111e5ccdf5.tar.zst
dexon-735b029db95bf72c3105674c0f2b4f111e5ccdf5.zip
core: return the index of the block that failed when inserting a chain
Diffstat (limited to 'cmd/utils/cmd.go')
-rw-r--r--cmd/utils/cmd.go4
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)
}
}