mirror of
https://github.com/kaspanet/kaspad.git
synced 2025-11-24 14:35:53 +00:00
Fix IBD sync conditions
This commit is contained in:
parent
d4a27bf1c1
commit
9bb19705a4
@ -285,7 +285,11 @@ func (flow *handleIBDFlow) isGenesisVirtualSelectedParent() (bool, error) {
|
|||||||
func (flow *handleIBDFlow) logIBDFinished(isFinishedSuccessfully bool, err error) {
|
func (flow *handleIBDFlow) logIBDFinished(isFinishedSuccessfully bool, err error) {
|
||||||
successString := "successfully"
|
successString := "successfully"
|
||||||
if !isFinishedSuccessfully {
|
if !isFinishedSuccessfully {
|
||||||
|
if err != nil {
|
||||||
successString = fmt.Sprintf("(interrupted: %s)", err)
|
successString = fmt.Sprintf("(interrupted: %s)", err)
|
||||||
|
} else {
|
||||||
|
successString = fmt.Sprintf("(interrupted)", err)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
log.Infof("IBD with peer %s finished %s", flow.peer, successString)
|
log.Infof("IBD with peer %s finished %s", flow.peer, successString)
|
||||||
}
|
}
|
||||||
|
|||||||
@ -85,12 +85,17 @@ func (flow *handleIBDFlow) shouldSyncAndShouldDownloadHeadersProof(
|
|||||||
return true, true, nil
|
return true, true, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if !highestKnownSyncerChainHash {
|
||||||
|
log.Infof("Stopping IBD since IBD from this node will cause a finality conflict")
|
||||||
return false, false, nil
|
return false, false, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
return false, true, nil
|
return false, true, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return false, true, nil
|
||||||
|
}
|
||||||
|
|
||||||
func (flow *handleIBDFlow) checkIfHighHashHasMoreBlueWorkThanSelectedTipAndPruningDepthMoreBlueScore(relayBlock *externalapi.DomainBlock) (bool, error) {
|
func (flow *handleIBDFlow) checkIfHighHashHasMoreBlueWorkThanSelectedTipAndPruningDepthMoreBlueScore(relayBlock *externalapi.DomainBlock) (bool, error) {
|
||||||
virtualSelectedParent, err := flow.Domain().Consensus().GetVirtualSelectedParent()
|
virtualSelectedParent, err := flow.Domain().Consensus().GetVirtualSelectedParent()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user