From c14e34cdb528d1009c4549cecc3e2659006a46ee Mon Sep 17 00:00:00 2001 From: Anna Shaleva Date: Mon, 8 Feb 2021 11:48:28 +0300 Subject: [PATCH] network: add RelayP2PNotaryRequest method --- pkg/network/server.go | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/pkg/network/server.go b/pkg/network/server.go index 14d488985..67293f732 100644 --- a/pkg/network/server.go +++ b/pkg/network/server.go @@ -835,10 +835,18 @@ func (s *Server) handleP2PNotaryRequestCmd(r *payload.P2PNotaryRequest) error { if !s.chain.P2PSigExtensionsEnabled() { return errors.New("P2PNotaryRequestCMD was received, but P2PSignatureExtensions are disabled") } - if s.verifyAndPoolNotaryRequest(r) == RelaySucceed { + s.RelayP2PNotaryRequest(r) + return nil +} + +// RelayP2PNotaryRequest adds given request to the pool and relays. It does not check +// P2PSigExtensions enabled. +func (s *Server) RelayP2PNotaryRequest(r *payload.P2PNotaryRequest) RelayReason { + ret := s.verifyAndPoolNotaryRequest(r) + if ret == RelaySucceed { s.broadcastP2PNotaryRequestPayload(nil, r) } - return nil + return ret } // verifyAndPoolNotaryRequest verifies NotaryRequest payload and adds it to the payload mempool.