aboutsummaryrefslogtreecommitdiffstats
path: root/dex
diff options
context:
space:
mode:
authorSonic <sonic@dexon.org>2019-04-19 12:32:53 +0800
committerWei-Ning Huang <w@byzantine-lab.io>2019-06-15 22:09:56 +0800
commitc17a0ebe45958741d84942f6dc71f0d8050252d1 (patch)
tree135f015c80c55068f3f8146872f32bbec9768fac /dex
parentba1dc7e71b4fc8d2744364208af39cc5ba0c6679 (diff)
downloadgo-tangerine-c17a0ebe45958741d84942f6dc71f0d8050252d1.tar.gz
go-tangerine-c17a0ebe45958741d84942f6dc71f0d8050252d1.tar.zst
go-tangerine-c17a0ebe45958741d84942f6dc71f0d8050252d1.zip
dex/downloader: fix find common ancestor (#376)
Diffstat (limited to 'dex')
-rw-r--r--dex/downloader/downloader.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/dex/downloader/downloader.go b/dex/downloader/downloader.go
index 9d609584b..0847cd062 100644
--- a/dex/downloader/downloader.go
+++ b/dex/downloader/downloader.go
@@ -848,7 +848,7 @@ func (d *Downloader) findAncestor(p *peerConnection, remoteHeader *types.Header)
default:
known = d.lightchain.HasHeader(h, n)
}
- if known {
+ if n <= localHeight && known {
number, hash = n, h
break
}
@@ -919,7 +919,7 @@ func (d *Downloader) findAncestor(p *peerConnection, remoteHeader *types.Header)
default:
known = d.lightchain.HasHeader(h, n)
}
- if !known {
+ if !known || n > localHeight {
end = check
break
}