Skip to content

eth/downloader/downloader_test.go — Version Comparison

v1.16.8 v1.17.3
Branch etc/v1.16.8-full-node etc/v1.17.3-full-node
Delta +7 -0 +7 -0
ETC delta on v1.16.8 (+7 -0)
diff --git a/eth/downloader/downloader_test.go b/eth/downloader/downloader_test.go
index c1a31d6e1..6a93f1c6f 100644
--- a/eth/downloader/downloader_test.go
+++ b/eth/downloader/downloader_test.go
@@ -125,6 +125,13 @@ type downloadTesterPeer struct {
    chain          *core.BlockChain
 }

+// Head constructs a function to retrieve a peer's current head hash
+// and total difficulty.
+func (dlp *downloadTesterPeer) Head() (common.Hash, *big.Int) {
+   head := dlp.chain.CurrentBlock()
+   return head.Hash(), dlp.chain.GetTd(head.Hash(), head.Number.Uint64())
+}
+
 func unmarshalRlpHeaders(rlpdata []rlp.RawValue) []*types.Header {
    var headers = make([]*types.Header, len(rlpdata))
    for i, data := range rlpdata {
ETC delta on v1.17.3 (+7 -0)
diff --git a/eth/downloader/downloader_test.go b/eth/downloader/downloader_test.go
index e6c477cd3..529dc6d7e 100644
--- a/eth/downloader/downloader_test.go
+++ b/eth/downloader/downloader_test.go
@@ -128,6 +128,13 @@ type downloadTesterPeer struct {
    dropped chan error // signaled when res.Done receives an error
 }

+// Head constructs a function to retrieve a peer's current head hash
+// and total difficulty.
+func (dlp *downloadTesterPeer) Head() (common.Hash, *big.Int) {
+   head := dlp.chain.CurrentBlock()
+   return head.Hash(), dlp.chain.GetTd(head.Hash(), head.Number.Uint64())
+}
+
 func unmarshalRlpHeaders(rlpdata []rlp.RawValue) []*types.Header {
    var headers = make([]*types.Header, len(rlpdata))
    for i, data := range rlpdata {

← Back to Version Comparison