diff options
author | Sonic <sonic@dexon.org> | 2018-12-04 16:13:41 +0800 |
---|---|---|
committer | Wei-Ning Huang <w@byzantine-lab.io> | 2019-06-12 17:27:19 +0800 |
commit | 5d031e08ed2758eb7fa9c2d9c107204f93ae0733 (patch) | |
tree | 3a7ed42404b9b9ace5424578c7b2753444014417 /dex/downloader/peer.go | |
parent | 122e398cd89925216226f8f5a194c93bf8921897 (diff) | |
download | go-tangerine-5d031e08ed2758eb7fa9c2d9c107204f93ae0733.tar go-tangerine-5d031e08ed2758eb7fa9c2d9c107204f93ae0733.tar.gz go-tangerine-5d031e08ed2758eb7fa9c2d9c107204f93ae0733.tar.bz2 go-tangerine-5d031e08ed2758eb7fa9c2d9c107204f93ae0733.tar.lz go-tangerine-5d031e08ed2758eb7fa9c2d9c107204f93ae0733.tar.xz go-tangerine-5d031e08ed2758eb7fa9c2d9c107204f93ae0733.tar.zst go-tangerine-5d031e08ed2758eb7fa9c2d9c107204f93ae0733.zip |
dex: replace total difficulty with block number (#73)
In dexon, we don't "mine" and the blockchain won't and shouldn't fork, so
there is no difficulty concept, just replace it with block number.
Note: this commit only replace total difficulty related logic and code
in dex, dex/downloader package.
Diffstat (limited to 'dex/downloader/peer.go')
-rw-r--r-- | dex/downloader/peer.go | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/dex/downloader/peer.go b/dex/downloader/peer.go index b6f2936b7..25c355df1 100644 --- a/dex/downloader/peer.go +++ b/dex/downloader/peer.go @@ -23,7 +23,6 @@ import ( "errors" "fmt" "math" - "math/big" "sort" "sync" "sync/atomic" @@ -77,7 +76,7 @@ type peerConnection struct { // LightPeer encapsulates the methods required to synchronise with a remote light peer. type LightPeer interface { - Head() (common.Hash, *big.Int) + Head() (common.Hash, uint64) RequestHeadersByHash(common.Hash, int, int, bool, bool) error RequestHeadersByNumber(uint64, int, int, bool, bool) error RequestGovStateByHash(common.Hash) error @@ -96,7 +95,7 @@ type lightPeerWrapper struct { peer LightPeer } -func (w *lightPeerWrapper) Head() (common.Hash, *big.Int) { return w.peer.Head() } +func (w *lightPeerWrapper) Head() (common.Hash, uint64) { return w.peer.Head() } func (w *lightPeerWrapper) RequestHeadersByHash(h common.Hash, amount int, skip int, reverse, withGov bool) error { return w.peer.RequestHeadersByHash(h, amount, skip, reverse, withGov) } |