From 10b714ad2247c9fcf7103bce21f65027493fdc54 Mon Sep 17 00:00:00 2001 From: buddh0 Date: Fri, 13 Sep 2024 09:50:05 +0800 Subject: [PATCH] eth/downloader: fix case in downloader_test --- eth/downloader/downloader_test.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/eth/downloader/downloader_test.go b/eth/downloader/downloader_test.go index 0a007644d2..9d3782a682 100644 --- a/eth/downloader/downloader_test.go +++ b/eth/downloader/downloader_test.go @@ -156,11 +156,12 @@ type downloadTesterPeer struct { func (dlp *downloadTesterPeer) MarkLagging() { } -// Head constructs a function to retrieve a peer's current head hash -// and total difficulty. -func (dlp *downloadTesterPeer) Head() (common.Hash, *big.Int) { +// Head constructs a function to retrieve a peer's current head hash, +// justifiedNumber and total difficulty. +func (dlp *downloadTesterPeer) Head() (common.Hash, *uint64, *big.Int) { head := dlp.chain.CurrentBlock() - return head.Hash(), dlp.chain.GetTd(head.Hash(), head.Number.Uint64()) + justifiedNumber := dlp.chain.GetJustifiedNumber(head) + return head.Hash(), &justifiedNumber, dlp.chain.GetTd(head.Hash(), head.Number.Uint64()) } func unmarshalRlpHeaders(rlpdata []rlp.RawValue) []*types.Header {