2019-02-25 22:44:14 +00:00
|
|
|
package peer
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/CityOfZion/neo-go/pkg/wire/payload"
|
|
|
|
"github.com/CityOfZion/neo-go/pkg/wire/protocol"
|
|
|
|
)
|
|
|
|
|
|
|
|
// LocalConfig specifies the properties that should be available for each remote peer
|
|
|
|
type LocalConfig struct {
|
|
|
|
Net protocol.Magic
|
|
|
|
UserAgent string
|
|
|
|
Services protocol.ServiceFlag
|
|
|
|
Nonce uint32
|
|
|
|
ProtocolVer protocol.Version
|
|
|
|
Relay bool
|
|
|
|
Port uint16
|
2019-03-28 19:09:55 +00:00
|
|
|
|
|
|
|
// pointer to config will keep the startheight updated
|
|
|
|
StartHeight func() uint32
|
|
|
|
|
|
|
|
// Response Handlers
|
2019-02-25 22:44:14 +00:00
|
|
|
OnHeader func(*Peer, *payload.HeadersMessage)
|
2019-03-28 19:09:55 +00:00
|
|
|
OnGetHeaders func(*Peer, *payload.GetHeadersMessage)
|
2019-02-25 22:44:14 +00:00
|
|
|
OnAddr func(*Peer, *payload.AddrMessage)
|
|
|
|
OnGetAddr func(*Peer, *payload.GetAddrMessage)
|
|
|
|
OnInv func(*Peer, *payload.InvMessage)
|
2019-03-28 19:09:55 +00:00
|
|
|
OnGetData func(*Peer, *payload.GetDataMessage)
|
2019-02-25 22:44:14 +00:00
|
|
|
OnBlock func(*Peer, *payload.BlockMessage)
|
2019-03-28 19:09:55 +00:00
|
|
|
OnGetBlocks func(*Peer, *payload.GetBlocksMessage)
|
|
|
|
OnTx func(*Peer, *payload.TXMessage)
|
2019-02-25 22:44:14 +00:00
|
|
|
}
|