mirror of
https://source.quilibrium.com/quilibrium/ceremonyclient.git
synced 2024-12-25 08:05:17 +00:00
fix: stop trying to sync with uncooperative peers
This commit is contained in:
parent
53a19f3f23
commit
b4ad1aed18
@ -158,6 +158,10 @@ func (e *CeremonyDataClockConsensusEngine) handleCeremonyPeerListAnnounce(
|
|||||||
|
|
||||||
e.peerMapMx.Lock()
|
e.peerMapMx.Lock()
|
||||||
for _, p := range announce.PeerList {
|
for _, p := range announce.PeerList {
|
||||||
|
if _, ok := e.uncooperativePeersMap[string(p.PeerId)]; ok {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
if bytes.Equal(p.PeerId, e.pubSub.GetPeerID()) {
|
if bytes.Equal(p.PeerId, e.pubSub.GetPeerID()) {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
@ -87,6 +87,7 @@ type CeremonyDataClockConsensusEngine struct {
|
|||||||
peerAnnounceMap map[string]*protobufs.CeremonyPeerListAnnounce
|
peerAnnounceMap map[string]*protobufs.CeremonyPeerListAnnounce
|
||||||
peerMap map[string]*peerInfo
|
peerMap map[string]*peerInfo
|
||||||
activeChannelsMap map[string]ChannelServer
|
activeChannelsMap map[string]ChannelServer
|
||||||
|
uncooperativePeersMap map[string]*peerInfo
|
||||||
fullResync bool
|
fullResync bool
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -157,6 +158,7 @@ func NewCeremonyDataClockConsensusEngine(
|
|||||||
syncingStatus: SyncStatusNotSyncing,
|
syncingStatus: SyncStatusNotSyncing,
|
||||||
peerAnnounceMap: map[string]*protobufs.CeremonyPeerListAnnounce{},
|
peerAnnounceMap: map[string]*protobufs.CeremonyPeerListAnnounce{},
|
||||||
peerMap: map[string]*peerInfo{},
|
peerMap: map[string]*peerInfo{},
|
||||||
|
uncooperativePeersMap: map[string]*peerInfo{},
|
||||||
}
|
}
|
||||||
|
|
||||||
logger.Info("constructing consensus engine")
|
logger.Info("constructing consensus engine")
|
||||||
|
@ -892,6 +892,10 @@ func (e *CeremonyDataClockConsensusEngine) collect(
|
|||||||
"could not establish direct channel",
|
"could not establish direct channel",
|
||||||
zap.Error(err),
|
zap.Error(err),
|
||||||
)
|
)
|
||||||
|
e.peerMapMx.Lock()
|
||||||
|
e.uncooperativePeersMap[string(peerId)] = e.peerMap[string(peerId)]
|
||||||
|
delete(e.peerMap, string(peerId))
|
||||||
|
e.peerMapMx.Unlock()
|
||||||
} else {
|
} else {
|
||||||
from := latest.FrameNumber
|
from := latest.FrameNumber
|
||||||
if from == 0 {
|
if from == 0 {
|
||||||
|
Loading…
Reference in New Issue
Block a user