aboutsummaryrefslogtreecommitdiffstats
path: root/dex/downloader/peer.go
diff options
context:
space:
mode:
authorSonic <sonic@dexon.org>2018-12-04 16:13:41 +0800
committerWei-Ning Huang <w@dexon.org>2019-03-12 12:19:09 +0800
commitf8df1206a75557714062905d4b802f337e680a42 (patch)
tree19d70a04c9edfcee2e52d3ff328ee0587706d5e8 /dex/downloader/peer.go
parent511054aa3d3b8d1e4eab33d891ef212196b50f6d (diff)
downloaddexon-f8df1206a75557714062905d4b802f337e680a42.tar
dexon-f8df1206a75557714062905d4b802f337e680a42.tar.gz
dexon-f8df1206a75557714062905d4b802f337e680a42.tar.bz2
dexon-f8df1206a75557714062905d4b802f337e680a42.tar.lz
dexon-f8df1206a75557714062905d4b802f337e680a42.tar.xz
dexon-f8df1206a75557714062905d4b802f337e680a42.tar.zst
dexon-f8df1206a75557714062905d4b802f337e680a42.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.go5
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)
}