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-04-09 21:32:54 +0800
commitdbdeb63000ae5626806432137799d560e19d33d0 (patch)
tree8c6d7614b4fd018cd9d9804786c729e0df85a8f8 /dex/downloader/peer.go
parent6de8d29263b2c184ddd0506d05a18d33554d9788 (diff)
downloaddexon-dbdeb63000ae5626806432137799d560e19d33d0.tar
dexon-dbdeb63000ae5626806432137799d560e19d33d0.tar.gz
dexon-dbdeb63000ae5626806432137799d560e19d33d0.tar.bz2
dexon-dbdeb63000ae5626806432137799d560e19d33d0.tar.lz
dexon-dbdeb63000ae5626806432137799d560e19d33d0.tar.xz
dexon-dbdeb63000ae5626806432137799d560e19d33d0.tar.zst
dexon-dbdeb63000ae5626806432137799d560e19d33d0.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)
}