-
Notifications
You must be signed in to change notification settings - Fork 0
/
handler.go
29 lines (21 loc) · 856 Bytes
/
handler.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
// (c) 2019-2021, Ava Labs, Inc. All rights reserved.
// See the file LICENSE for licensing terms.
package message
import (
"github.com/ethereum/go-ethereum/log"
"github.com/Toinounet21/avalanchego-trafficked-v1.7.4/ids"
)
var _ Handler = NoopHandler{}
type Handler interface {
HandleAtomicTx(nodeID ids.ShortID, requestID uint32, msg *AtomicTx) error
HandleEthTxs(nodeID ids.ShortID, requestID uint32, msg *EthTxs) error
}
type NoopHandler struct{}
func (NoopHandler) HandleAtomicTx(nodeID ids.ShortID, requestID uint32, _ *AtomicTx) error {
log.Debug("dropping unexpected AtomicTx message", "peerID", nodeID, "requestID", requestID)
return nil
}
func (NoopHandler) HandleEthTxs(nodeID ids.ShortID, requestID uint32, _ *EthTxs) error {
log.Debug("dropping unexpected EthTxs message", "peerID", nodeID, "requestID", requestID)
return nil
}