aboutsummaryrefslogtreecommitdiffstats
path: root/p2p
diff options
context:
space:
mode:
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