Parcourir la source

update stale depth

fudongbai il y a 5 ans
Parent
commit
2ff7a21d64
2 fichiers modifiés avec 4 ajouts et 4 suppressions
  1. 1 1
      eth/fetcher/block_fetcher.go
  2. 3 3
      miner/worker.go

+ 1 - 1
eth/fetcher/block_fetcher.go

@@ -37,7 +37,7 @@ const (
 )
 
 const (
-	maxUncleDist = 7   // Maximum allowed backward distance from the chain head
+	maxUncleDist = 11  // Maximum allowed backward distance from the chain head
 	maxQueueDist = 32  // Maximum allowed distance from the chain head to queue
 	hashLimit    = 256 // Maximum number of unique blocks a peer may have announced
 	blockLimit   = 64  // Maximum number of unique blocks a peer may have delivered

+ 3 - 3
miner/worker.go

@@ -56,7 +56,7 @@ const (
 	resubmitAdjustChanSize = 10
 
 	// miningLogAtDepth is the number of confirmations before logging successful mining.
-	miningLogAtDepth = 15
+	miningLogAtDepth = 11
 
 	// minRecommitInterval is the minimal time interval to recreate the mining block with
 	// any newly arrived transactions.
@@ -75,7 +75,7 @@ const (
 	intervalAdjustBias = 200 * 1000.0 * 1000.0
 
 	// staleThreshold is the maximum depth of the acceptable stale block.
-	staleThreshold = 7
+	staleThreshold = 11
 )
 
 var (
@@ -356,7 +356,7 @@ func (w *worker) newWorkLoop(recommit time.Duration) {
 			commit(false, commitInterruptNewHead)
 
 		case head := <-w.chainHeadCh:
-			if !w.isRunning(){
+			if !w.isRunning() {
 				continue
 			}
 			clearPending(head.Block.NumberU64())