• R/O
  • HTTP
  • SSH
  • HTTPS

vapor: Commit

Golang implemented sidechain for Bytom


Commit MetaInfo

Revision380ed46cc0a3cc14acae33b19777971d8f66f14c (tree)
Time2019-06-20 11:26:17
AuthorYahtoo Ma <yahtoo.ma@gmai...>
CommiterYahtoo Ma

Log Message

Add debug info

Change Summary

Incremental Difference

--- a/netsync/chainmgr/fast_sync.go
+++ b/netsync/chainmgr/fast_sync.go
@@ -3,6 +3,7 @@ package chainmgr
33 import (
44 "time"
55
6+ "fmt"
67 log "github.com/sirupsen/logrus"
78 "github.com/vapor/errors"
89 "github.com/vapor/protocol/bc"
@@ -14,7 +15,7 @@ var (
1415 fetchDataParallelTimeout = 100 * time.Second
1516
1617 maxFetchRetryNum = 3
17- maxBlockPerMsg = 500
18+ maxBlockPerMsg = 501
1819 maxBlockHeadersPerMsg = 500
1920 minGapStartFastSync = 128
2021 maxFastSyncBlockNum = 10000
@@ -161,7 +162,7 @@ func (bk *blockKeeper) locateBlocks(locator []*bc.Hash, stopHash *bc.Hash) ([]*t
161162 if err != nil {
162163 return nil, err
163164 }
164-
165+ fmt.Println("====start:", headers[0].Height, "====stop:", headers[len(headers)-1].Height)
165166 blocks := []*types.Block{}
166167 for i, header := range headers {
167168 if i >= maxBlockPerMsg {
@@ -241,6 +242,7 @@ func (bk *blockKeeper) requireBlocks(peerID string, locator []*bc.Hash, stopHash
241242 continue
242243 }
243244 if len(msg.blocks) != length {
245+ fmt.Println("got:", len(msg.blocks), "want:", length)
244246 return nil, errBlocksNum
245247 }
246248
Show on old repository browser