From 7b41c034099f2feb6f21009d6c381065f9cd507d Mon Sep 17 00:00:00 2001 From: William Banfield Date: Wed, 19 Oct 2022 20:51:42 -0400 Subject: [PATCH] shim in new receive to the reactor interface --- p2p/base_reactor.go | 2 ++ p2p/peer.go | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/p2p/base_reactor.go b/p2p/base_reactor.go index 14025b590..cac9054f2 100644 --- a/p2p/base_reactor.go +++ b/p2p/base_reactor.go @@ -45,6 +45,8 @@ type Reactor interface { // // CONTRACT: msgBytes are not nil. Receive(chID byte, peer Peer, msgBytes []byte) + + NewReceive(Envelope) } //-------------------------------------- diff --git a/p2p/peer.go b/p2p/peer.go index 081e22283..c7db24893 100644 --- a/p2p/peer.go +++ b/p2p/peer.go @@ -414,6 +414,10 @@ func createMConnection( } p.metrics.PeerReceiveBytesTotal.With(labels...).Add(float64(len(msgBytes))) reactor.Receive(chID, p, msgBytes) + reactor.NewReceive(Envelope{ + ChannelID: chID, + Src: p, + }) } onError := func(r interface{}) {