diff --git a/p2p/message.go b/p2p/message.go index be6405d6f03a67fa70b3abf04a18ac53e52517fc..5ab5ab73e0878cf18c19a82e53be0b8e66b05e5a 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 1262ba64a7cbf3e26e2dcbe5fa796d9fe217e2b6..bc0e6eb5f17ecfe67920d255eb813c0a30c49ee8 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