forked from cerc-io/plugeth
p2p: added received at to peer message
p2p.Msg.ReceivedAt can be used for determining block propagation from begining to end.
This commit is contained in:
parent
9e63798d03
commit
01e3d694a6
@ -25,6 +25,7 @@ type Msg struct {
|
||||
Code uint64
|
||||
Size uint32 // size of the paylod
|
||||
Payload io.Reader
|
||||
ReceivedAt time.Time
|
||||
}
|
||||
|
||||
// Decode parses the RLP content of a message into
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user