forked from cerc-io/plugeth
Idle too long error incorrectly triggered even when peer sending new blocks
- fix status chain map uses common.Hash as key - add badPeers increment to IncorrectTD errors (forgotten) - signal head info update to head section process even if parent hash is not in pool (inserted), so that idle timer can be set to nil - suicideC -> peer.headInfoTimer - quit -> peer.bestIdleTimer - and they are properly set from within getBlockHashes and handleSection
This commit is contained in:
+4
-2
@@ -3,6 +3,8 @@ package blockpool
|
||||
import (
|
||||
"fmt"
|
||||
"sync"
|
||||
|
||||
"github.com/ethereum/go-ethereum/common"
|
||||
)
|
||||
|
||||
type statusValues struct {
|
||||
@@ -26,7 +28,7 @@ type statusValues struct {
|
||||
type status struct {
|
||||
lock sync.Mutex
|
||||
values statusValues
|
||||
chain map[string]int
|
||||
chain map[common.Hash]int
|
||||
peers map[string]int
|
||||
bestPeers map[string]int
|
||||
badPeers map[string]int
|
||||
@@ -35,7 +37,7 @@ type status struct {
|
||||
|
||||
func newStatus() *status {
|
||||
return &status{
|
||||
chain: make(map[string]int),
|
||||
chain: make(map[common.Hash]int),
|
||||
peers: make(map[string]int),
|
||||
bestPeers: make(map[string]int),
|
||||
badPeers: make(map[string]int),
|
||||
|
||||
Reference in New Issue
Block a user