mirror of
https://github.com/kaspanet/kaspad.git
synced 2025-11-27 07:48:44 +00:00
On negotiation check only blocks in future of PP
This commit is contained in:
parent
a9e4fabeed
commit
88ecede2ae
@ -175,6 +175,11 @@ func (flow *handleIBDFlow) negotiateMissingSyncerChainSegment() (*externalapi.Do
|
|||||||
chainNegotiationRestartCounter := 0
|
chainNegotiationRestartCounter := 0
|
||||||
chainNegotiationZoomCounts := 0
|
chainNegotiationZoomCounts := 0
|
||||||
initialLocatorLen := len(locatorHashes)
|
initialLocatorLen := len(locatorHashes)
|
||||||
|
pruningPoint, err := flow.Domain().Consensus().PruningPoint()
|
||||||
|
if err != nil {
|
||||||
|
return nil, nil, err
|
||||||
|
}
|
||||||
|
|
||||||
for {
|
for {
|
||||||
var lowestUnknownSyncerChainHash, currentHighestKnownSyncerChainHash *externalapi.DomainHash
|
var lowestUnknownSyncerChainHash, currentHighestKnownSyncerChainHash *externalapi.DomainHash
|
||||||
for _, syncerChainHash := range locatorHashes {
|
for _, syncerChainHash := range locatorHashes {
|
||||||
@ -187,8 +192,15 @@ func (flow *handleIBDFlow) negotiateMissingSyncerChainSegment() (*externalapi.Do
|
|||||||
return nil, nil, protocolerrors.Errorf(true, "Sent invalid chain block %s", syncerChainHash)
|
return nil, nil, protocolerrors.Errorf(true, "Sent invalid chain block %s", syncerChainHash)
|
||||||
}
|
}
|
||||||
|
|
||||||
currentHighestKnownSyncerChainHash = syncerChainHash
|
isInSelectedParentChainOfPruningPoint, err := flow.Domain().Consensus().IsInSelectedParentChainOf(pruningPoint, syncerChainHash)
|
||||||
break
|
if err != nil {
|
||||||
|
return nil, nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
if isInSelectedParentChainOfPruningPoint {
|
||||||
|
currentHighestKnownSyncerChainHash = syncerChainHash
|
||||||
|
break
|
||||||
|
}
|
||||||
}
|
}
|
||||||
lowestUnknownSyncerChainHash = syncerChainHash
|
lowestUnknownSyncerChainHash = syncerChainHash
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user