network: fix Inv types for Neo 3
They actually use the same types as for messages. Fixes 2020-05-29T00:06:17.593+0300 WARN peer disconnected {"addr": "168.62.167.190:20333", "reason": "handling CMDInv message: invalid inventory type", "peerCount": 3}
This commit is contained in:
parent
56b24bf83e
commit
eec462b00c
2 changed files with 9 additions and 9 deletions
|
@ -68,9 +68,9 @@ const (
|
||||||
CMDGetData CommandType = 0x28
|
CMDGetData CommandType = 0x28
|
||||||
CMDGetBlockData CommandType = 0x29
|
CMDGetBlockData CommandType = 0x29
|
||||||
CMDUnknown CommandType = 0x2a
|
CMDUnknown CommandType = 0x2a
|
||||||
CMDTX CommandType = 0x2b
|
CMDTX = CommandType(payload.TXType)
|
||||||
CMDBlock CommandType = 0x2c
|
CMDBlock = CommandType(payload.BlockType)
|
||||||
CMDConsensus CommandType = 0x2d
|
CMDConsensus = CommandType(payload.ConsensusType)
|
||||||
CMDReject CommandType = 0x2f
|
CMDReject CommandType = 0x2f
|
||||||
|
|
||||||
// SPV protocol
|
// SPV protocol
|
||||||
|
|
|
@ -14,11 +14,11 @@ type InventoryType uint8
|
||||||
// String implements the Stringer interface.
|
// String implements the Stringer interface.
|
||||||
func (i InventoryType) String() string {
|
func (i InventoryType) String() string {
|
||||||
switch i {
|
switch i {
|
||||||
case 0x01:
|
case TXType:
|
||||||
return "TX"
|
return "TX"
|
||||||
case 0x02:
|
case BlockType:
|
||||||
return "block"
|
return "block"
|
||||||
case 0xe0:
|
case ConsensusType:
|
||||||
return "consensus"
|
return "consensus"
|
||||||
default:
|
default:
|
||||||
return "unknown inventory type"
|
return "unknown inventory type"
|
||||||
|
@ -32,9 +32,9 @@ func (i InventoryType) Valid() bool {
|
||||||
|
|
||||||
// List of valid InventoryTypes.
|
// List of valid InventoryTypes.
|
||||||
const (
|
const (
|
||||||
TXType InventoryType = 0x01 // 1
|
TXType InventoryType = 0x2b
|
||||||
BlockType InventoryType = 0x02 // 2
|
BlockType InventoryType = 0x2c
|
||||||
ConsensusType InventoryType = 0xe0 // 224
|
ConsensusType InventoryType = 0x2d
|
||||||
)
|
)
|
||||||
|
|
||||||
// Inventory payload.
|
// Inventory payload.
|
||||||
|
|
Loading…
Add table
Reference in a new issue