Cleanup
This commit is contained in:
parent
d65b64c884
commit
ed621aae33
@ -69,7 +69,7 @@ func importChain(ctx *cli.Context) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func exportChain(ctx *cli.Context) {
|
func exportChain(ctx *cli.Context) {
|
||||||
if len(ctx.Args()) != 1 {
|
if len(ctx.Args()) < 1 {
|
||||||
utils.Fatalf("This command requires an argument.")
|
utils.Fatalf("This command requires an argument.")
|
||||||
}
|
}
|
||||||
chain, _, _, _ := utils.MakeChain(ctx)
|
chain, _, _, _ := utils.MakeChain(ctx)
|
||||||
|
@ -351,13 +351,12 @@ func (self *ChainManager) Export(w io.Writer) error {
|
|||||||
func (self *ChainManager) ExportN(w io.Writer, first uint64, last uint64) error {
|
func (self *ChainManager) ExportN(w io.Writer, first uint64, last uint64) error {
|
||||||
self.mu.RLock()
|
self.mu.RLock()
|
||||||
defer self.mu.RUnlock()
|
defer self.mu.RUnlock()
|
||||||
glog.V(logger.Info).Infof("exporting %v blocks...\n", self.currentBlock.Header().Number)
|
|
||||||
|
|
||||||
if first > last {
|
if first > last {
|
||||||
return fmt.Errorf("export failed: first (%d) is greater than last (%d)", first, last)
|
return fmt.Errorf("export failed: first (%d) is greater than last (%d)", first, last)
|
||||||
}
|
}
|
||||||
|
|
||||||
glog.V(logger.Info).Infof("exporting %d blocks...\n", last-first)
|
glog.V(logger.Info).Infof("exporting %d blocks...\n", last-first+1)
|
||||||
|
|
||||||
for nr := first; nr <= last; nr++ {
|
for nr := first; nr <= last; nr++ {
|
||||||
block := self.GetBlockByNumber(nr)
|
block := self.GetBlockByNumber(nr)
|
||||||
|
Loading…
Reference in New Issue
Block a user