Dont write pprof info in addblock.

dont write pprof info in addblock  (ok drahn); and make progress a little
more silent
This commit is contained in:
Marco Peereboom 2014-01-07 15:39:38 -06:00 committed by Dave Collins
parent d00ccc0d3c
commit 96ded50f6b

View file

@ -18,7 +18,6 @@ import (
"os"
"path/filepath"
"runtime"
"runtime/pprof"
)
type ShaHash btcwire.ShaHash
@ -146,26 +145,19 @@ func main() {
blkP.complete <- true
db.InsertBlock(blkP.blk)
if cfg.Progress && eheight%int64(1) == 0 {
if cfg.Progress && eheight%int64(10000) == 0 {
log.Infof("Processing block %v", eheight)
}
eheight++
if eheight%2000 == 0 {
f, err := os.Create(fmt.Sprintf("profile.%d", eheight))
if err == nil {
pprof.WriteHeapProfile(f)
f.Close()
} else {
log.Warnf("profile failed %v", err)
}
}
} else {
break
}
}
}
}
if cfg.Progress {
log.Infof("Processing block %v", eheight)
}
}
func processBuf(idx int, bufqueue chan *bufQueue, blkqueue chan *blkQueue) {