diff --git a/p2p/synch/snapsync.go b/p2p/synch/snapsync.go index 73f69e32..d23d8022 100644 --- a/p2p/synch/snapsync.go +++ b/p2p/synch/snapsync.go @@ -107,12 +107,18 @@ cleanup: } else { log.Warn("Snap-sync illegal ended", "spend", time.Since(startTime).Truncate(time.Second).String(), "add", add, "processID", ps.getProcessID()) } - ps.snapStatus = nil ps.SetSyncPeer(nil) ps.processwg.Done() - return false + if ps.snapStatus.isCompleted() { + ps.snapStatus = nil + return false + } else { + ps.snapStatus = nil + go ps.TryAgainUpdateSyncPeer(false) + return true + } } func (ps *PeerSync) syncSnapStatus(pe *peers.Peer) (*pb.SnapSyncRsp, error) { diff --git a/services/common/flags.go b/services/common/flags.go index d6008828..934bc9d7 100644 --- a/services/common/flags.go +++ b/services/common/flags.go @@ -643,13 +643,11 @@ var ( &cli.BoolFlag{ Name: "dev_snapsync", Usage: "Enable snap sync for P2P that only exist in development mode", - Value: true, Destination: &cfg.DevSnapSync, }, &cli.BoolFlag{ Name: "generatenodevgap", Usage: "Generate (mine) coins using the CPU on develop mode whithout gap", - Value: true, Destination: &cfg.GenerateNoDevGap, }, }