diff options
author | Sonic <sonic@dexon.org> | 2019-04-19 12:32:53 +0800 |
---|---|---|
committer | Wei-Ning Huang <w@byzantine-lab.io> | 2019-06-15 22:09:56 +0800 |
commit | c17a0ebe45958741d84942f6dc71f0d8050252d1 (patch) | |
tree | 135f015c80c55068f3f8146872f32bbec9768fac /dex | |
parent | ba1dc7e71b4fc8d2744364208af39cc5ba0c6679 (diff) | |
download | go-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.go | 4 |
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 } |