2020-09-03 14:04:04 +00:00
|
|
|
package netmap
|
|
|
|
|
|
|
|
import (
|
2021-09-23 16:12:49 +00:00
|
|
|
"github.com/nspcc-dev/neo-go/pkg/network/payload"
|
2020-09-03 14:04:04 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
type AddPeer struct {
|
2023-04-27 14:57:27 +00:00
|
|
|
NodeBytes []byte
|
2021-09-23 16:12:49 +00:00
|
|
|
|
|
|
|
// For notary notifications only.
|
|
|
|
// Contains raw transactions of notary request.
|
2023-04-27 14:57:27 +00:00
|
|
|
Request *payload.P2PNotaryRequest
|
2020-09-03 14:04:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// MorphEvent implements Neo:Morph Event interface.
|
|
|
|
func (AddPeer) MorphEvent() {}
|
|
|
|
|
|
|
|
func (s AddPeer) Node() []byte {
|
2023-04-27 14:57:27 +00:00
|
|
|
return s.NodeBytes
|
2020-09-03 14:04:04 +00:00
|
|
|
}
|
|
|
|
|
2021-09-23 16:12:49 +00:00
|
|
|
// NotaryRequest returns raw notary request if notification
|
|
|
|
// was received via notary service. Otherwise, returns nil.
|
|
|
|
func (s AddPeer) NotaryRequest() *payload.P2PNotaryRequest {
|
2023-04-27 14:57:27 +00:00
|
|
|
return s.Request
|
2021-09-23 16:12:49 +00:00
|
|
|
}
|
|
|
|
|
2021-09-08 13:54:45 +00:00
|
|
|
const expectedItemNumAddPeer = 1
|