aboutsummaryrefslogtreecommitdiffstats
path: root/eth/peer.go
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2015-07-09 18:55:06 +0800
committerPéter Szilágyi <peterke@gmail.com>2015-07-09 18:55:06 +0800
commit4f95e2f9ec3e416773e6a87b3c76667d97894f36 (patch)
treec98b17aa87889cc04bc4c7c27d56ec7b33eefe0f /eth/peer.go
parenta2333bcbb46245e07357be1f9af4108e9bf1fe40 (diff)
downloadgo-tangerine-4f95e2f9ec3e416773e6a87b3c76667d97894f36.tar.gz
go-tangerine-4f95e2f9ec3e416773e6a87b3c76667d97894f36.tar.zst
go-tangerine-4f95e2f9ec3e416773e6a87b3c76667d97894f36.zip
eth: calculate the correct TD, only update if better
Diffstat (limited to 'eth/peer.go')
-rw-r--r--eth/peer.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/eth/peer.go b/eth/peer.go
index ccd5d3c6f..d70ad4c94 100644
--- a/eth/peer.go
+++ b/eth/peer.go
@@ -167,12 +167,12 @@ func (p *peer) SendNewBlockHashes(hashes []common.Hash) error {
}
// SendNewBlock propagates an entire block to a remote peer.
-func (p *peer) SendNewBlock(block *types.Block) error {
+func (p *peer) SendNewBlock(block *types.Block, td *big.Int) error {
propBlockOutPacketsMeter.Mark(1)
propBlockOutTrafficMeter.Mark(block.Size().Int64())
p.knownBlocks.Add(block.Hash())
- return p2p.Send(p.rw, NewBlockMsg, []interface{}{block, block.Td})
+ return p2p.Send(p.rw, NewBlockMsg, []interface{}{block, td})
}
// RequestHashes fetches a batch of hashes from a peer, starting at from, going