diff options
author | Sonic <sonic@dexon.org> | 2019-04-19 12:32:53 +0800 |
---|---|---|
committer | Wei-Ning Huang <w@dexon.org> | 2019-04-20 13:46:12 +0800 |
commit | 12936254a5c54f788ba8963abb54da2e350d5f55 (patch) | |
tree | e673f79f0d04e44e6eaedb418ab9a03699fe692a | |
parent | e7fb98f71cdc141ab18232a0f3b76932c0c9d40d (diff) | |
download | dexon-12936254a5c54f788ba8963abb54da2e350d5f55.tar.gz dexon-12936254a5c54f788ba8963abb54da2e350d5f55.tar.zst dexon-12936254a5c54f788ba8963abb54da2e350d5f55.zip |
dex/downloader: fix find common ancestor (#376)
-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 } |