Skip to content

Commit 95e0448

Browse files
committed
fix
1 parent b48b55c commit 95e0448

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

monitor.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -124,13 +124,13 @@ func New(flag *params.Config, cache, compress, listen bool, callback chan any) (
124124
exitCh: make(chan any),
125125
srvCh: make(chan int),
126126
//exitSyncCh: make(chan any),
127-
scope: uint64(math.Min(float64(runtime.NumCPU()), float64(8))),
128-
taskCh: make(chan *types.Block, batch),
127+
scope: uint64(math.Min(float64(runtime.NumCPU()), float64(8))),
128+
//taskCh: make(chan *types.Block, batch),
129129
//taskCh: make(chan *types.Block, 1),
130130
//start: mclock.Now(),
131131
}
132132
m.errCh = make(chan error, m.scope)
133-
133+
m.taskCh = make(chan *types.Block, m.scope)
134134
// TODO https://github.com/ucwong/golang-kv
135135
if fs_, err := backend.NewChainDB(flag); err != nil {
136136
log.Error("file storage failed", "err", err)
@@ -942,7 +942,9 @@ func (m *Monitor) forExchangeService(block *types.Block) error {
942942
}
943943

944944
func (m *Monitor) forRecordService(block *types.Block) error {
945-
log.Debug("Block record", "num", block.Number, "hash", block.Hash, "txs", len(block.Txs), "last", m.lastNumber.Load())
945+
if block.Number%4096 == 0 {
946+
log.Info("Block record", "num", block.Number, "hash", block.Hash, "txs", len(block.Txs), "last", m.lastNumber.Load())
947+
}
946948
if len(block.Txs) > 0 {
947949
for _, t := range block.Txs {
948950
x := new(big.Float).Quo(new(big.Float).SetInt(t.Amount), new(big.Float).SetInt(big.NewInt(params1.Cortex)))

0 commit comments

Comments
 (0)