network: extend errInvalidInvType error

Add type to the errInvalidInvType.

Signed-off-by: Ekaterina Pavlova <ekt@morphbits.io>
This commit is contained in:
Ekaterina Pavlova 2024-06-05 14:27:11 +03:00
parent 4a5e8f8592
commit 4d6333866d

View file

@ -1353,7 +1353,7 @@ func (s *Server) handleMessage(peer Peer, msg *Message) error {
if peer.Handshaked() { if peer.Handshaked() {
if inv, ok := msg.Payload.(*payload.Inventory); ok { if inv, ok := msg.Payload.(*payload.Inventory); ok {
if !inv.Type.Valid(s.chain.P2PSigExtensionsEnabled()) || len(inv.Hashes) == 0 { if !inv.Type.Valid(s.chain.P2PSigExtensionsEnabled()) || len(inv.Hashes) == 0 {
return errInvalidInvType return fmt.Errorf("%w: %s", errInvalidInvType, inv.Type.String())
} }
} }
switch msg.Command { switch msg.Command {