aboutsummaryrefslogtreecommitdiffstats
path: root/p2p
diff options
context:
space:
mode:
authorJeffrey Wilcke <jeffrey@ethereum.org>2015-04-30 06:52:25 +0800
committerJeffrey Wilcke <jeffrey@ethereum.org>2015-04-30 06:52:25 +0800
commit3fef60190384106af390dd23a65384b9cc6e4a28 (patch)
tree49f52b8bba6af0228bb20758dd1465f8dce6842d /p2p
parent764e81bf12bc45b00cec7db216e72d6396cf0c13 (diff)
parent30b921ef463247da63dece1cb81887f7e66668ff (diff)
downloadgo-tangerine-3fef60190384106af390dd23a65384b9cc6e4a28.tar.gz
go-tangerine-3fef60190384106af390dd23a65384b9cc6e4a28.tar.zst
go-tangerine-3fef60190384106af390dd23a65384b9cc6e4a28.zip
Merge pull request #830 from obscuren/downloader-missing-parent
eth/downloader: missing parent improvement
Diffstat (limited to 'p2p')
-rw-r--r--p2p/message.go7
-rw-r--r--p2p/peer.go1
2 files changed, 5 insertions, 3 deletions
diff --git a/p2p/message.go b/p2p/message.go
index be6405d6f..5ab5ab73e 100644
--- a/p2p/message.go
+++ b/p2p/message.go
@@ -22,9 +22,10 @@ import (
// structure, encode the payload into a byte array and create a
// separate Msg with a bytes.Reader as Payload for each send.
type Msg struct {
- Code uint64
- Size uint32 // size of the paylod
- Payload io.Reader
+ Code uint64
+ Size uint32 // size of the paylod
+ Payload io.Reader
+ ReceivedAt time.Time
}
// Decode parses the RLP content of a message into
diff --git a/p2p/peer.go b/p2p/peer.go
index 1262ba64a..bc0e6eb5f 100644
--- a/p2p/peer.go
+++ b/p2p/peer.go
@@ -177,6 +177,7 @@ func (p *Peer) readLoop(errc chan<- error) {
errc <- err
return
}
+ msg.ReceivedAt = time.Now()
if err = p.handle(msg); err != nil {
errc <- err
return