From db2e214f7eae033434124e626b3d6c579bb4ea95 Mon Sep 17 00:00:00 2001 From: Roman Khimov Date: Wed, 10 Jan 2024 16:29:00 +0300 Subject: [PATCH 1/2] network: add debug for notary payloads Can be handy if things go wrong. Signed-off-by: Roman Khimov --- pkg/network/server.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkg/network/server.go b/pkg/network/server.go index fdce2f41b..30c221257 100644 --- a/pkg/network/server.go +++ b/pkg/network/server.go @@ -1169,7 +1169,10 @@ func (s *Server) handleP2PNotaryRequestCmd(r *payload.P2PNotaryRequest) error { } // It's OK for it to fail for various reasons like request already existing // in the pool. - _ = s.RelayP2PNotaryRequest(r) + err := s.RelayP2PNotaryRequest(r) + if err != nil { + s.log.Debug("p2p notary request", zap.Error(err), zap.String("hash", r.Hash().StringLE()), zap.String("main", r.MainTransaction.Hash().StringLE())) + } return nil } From f9a82ae45f8160f6a34e0b461a7e741cd4e8bb22 Mon Sep 17 00:00:00 2001 From: Roman Khimov Date: Thu, 11 Jan 2024 19:13:26 +0300 Subject: [PATCH 2/2] network: add debug for transactions as well Signed-off-by: Roman Khimov --- pkg/network/server.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkg/network/server.go b/pkg/network/server.go index 30c221257..e000c18c5 100644 --- a/pkg/network/server.go +++ b/pkg/network/server.go @@ -1142,8 +1142,11 @@ txloop: } } } - if s.verifyAndPoolTX(tx) == nil { + err := s.verifyAndPoolTX(tx) + if err == nil { s.broadcastTX(tx, nil) + } else { + s.log.Debug("tx handler", zap.Error(err), zap.String("hash", tx.Hash().StringLE())) } s.txInLock.Lock() delete(s.txInMap, tx.Hash())