@@ -103,24 +103,24 @@ func (msg Transactions) Code() int { return 18 }
103
103
func (msg Transactions ) ReqID () uint64 { return 18 }
104
104
105
105
// GetBlockHeaders represents a block header query.
106
- type GetBlockHeaders eth.GetBlockHeadersPacket66
106
+ type GetBlockHeaders eth.GetBlockHeadersPacket
107
107
108
108
func (msg GetBlockHeaders ) Code () int { return 19 }
109
109
func (msg GetBlockHeaders ) ReqID () uint64 { return msg .RequestId }
110
110
111
- type BlockHeaders eth.BlockHeadersPacket66
111
+ type BlockHeaders eth.BlockHeadersPacket
112
112
113
113
func (msg BlockHeaders ) Code () int { return 20 }
114
114
func (msg BlockHeaders ) ReqID () uint64 { return msg .RequestId }
115
115
116
116
// GetBlockBodies represents a GetBlockBodies request
117
- type GetBlockBodies eth.GetBlockBodiesPacket66
117
+ type GetBlockBodies eth.GetBlockBodiesPacket
118
118
119
119
func (msg GetBlockBodies ) Code () int { return 21 }
120
120
func (msg GetBlockBodies ) ReqID () uint64 { return msg .RequestId }
121
121
122
122
// BlockBodies is the network packet for block content distribution.
123
- type BlockBodies eth.BlockBodiesPacket66
123
+ type BlockBodies eth.BlockBodiesPacket
124
124
125
125
func (msg BlockBodies ) Code () int { return 22 }
126
126
func (msg BlockBodies ) ReqID () uint64 { return msg .RequestId }
@@ -132,7 +132,7 @@ func (msg NewBlock) Code() int { return 23 }
132
132
func (msg NewBlock ) ReqID () uint64 { return 0 }
133
133
134
134
// NewPooledTransactionHashes66 is the network packet for the tx hash propagation message.
135
- type NewPooledTransactionHashes66 eth.NewPooledTransactionHashesPacket66
135
+ type NewPooledTransactionHashes66 eth.NewPooledTransactionHashesPacket67
136
136
137
137
func (msg NewPooledTransactionHashes66 ) Code () int { return 24 }
138
138
func (msg NewPooledTransactionHashes66 ) ReqID () uint64 { return 0 }
@@ -143,7 +143,7 @@ type NewPooledTransactionHashes eth.NewPooledTransactionHashesPacket68
143
143
func (msg NewPooledTransactionHashes ) Code () int { return 24 }
144
144
func (msg NewPooledTransactionHashes ) ReqID () uint64 { return 0 }
145
145
146
- type GetPooledTransactions eth.GetPooledTransactionsPacket66
146
+ type GetPooledTransactions eth.GetPooledTransactionsPacket
147
147
148
148
func (msg GetPooledTransactions ) Code () int { return 25 }
149
149
func (msg GetPooledTransactions ) ReqID () uint64 { return msg .RequestId }
@@ -200,25 +200,25 @@ func (c *Conn) Read() (Message, error) {
200
200
case (Status {}).Code ():
201
201
msg = new (Status )
202
202
case (GetBlockHeaders {}).Code ():
203
- ethMsg := new (eth.GetBlockHeadersPacket66 )
203
+ ethMsg := new (eth.GetBlockHeadersPacket )
204
204
if err := rlp .DecodeBytes (rawData , ethMsg ); err != nil {
205
205
return nil , errorf ("could not rlp decode message: %v, %x" , err , rawData )
206
206
}
207
207
return (* GetBlockHeaders )(ethMsg ), nil
208
208
case (BlockHeaders {}).Code ():
209
- ethMsg := new (eth.BlockHeadersPacket66 )
209
+ ethMsg := new (eth.BlockHeadersPacket )
210
210
if err := rlp .DecodeBytes (rawData , ethMsg ); err != nil {
211
211
return nil , errorf ("could not rlp decode message: %v, %x" , err , rawData )
212
212
}
213
213
return (* BlockHeaders )(ethMsg ), nil
214
214
case (GetBlockBodies {}).Code ():
215
- ethMsg := new (eth.GetBlockBodiesPacket66 )
215
+ ethMsg := new (eth.GetBlockBodiesPacket )
216
216
if err := rlp .DecodeBytes (rawData , ethMsg ); err != nil {
217
217
return nil , errorf ("could not rlp decode message: %v, %x" , err , rawData )
218
218
}
219
219
return (* GetBlockBodies )(ethMsg ), nil
220
220
case (BlockBodies {}).Code ():
221
- ethMsg := new (eth.BlockBodiesPacket66 )
221
+ ethMsg := new (eth.BlockBodiesPacket )
222
222
if err := rlp .DecodeBytes (rawData , ethMsg ); err != nil {
223
223
return nil , errorf ("could not rlp decode message: %v, %x" , err , rawData )
224
224
}
@@ -237,7 +237,7 @@ func (c *Conn) Read() (Message, error) {
237
237
}
238
238
msg = new (NewPooledTransactionHashes66 )
239
239
case (GetPooledTransactions {}.Code ()):
240
- ethMsg := new (eth.GetPooledTransactionsPacket66 )
240
+ ethMsg := new (eth.GetPooledTransactionsPacket )
241
241
if err := rlp .DecodeBytes (rawData , ethMsg ); err != nil {
242
242
return nil , errorf ("could not rlp decode message: %v, %x" , err , rawData )
243
243
}
@@ -422,8 +422,8 @@ func (c *Conn) readAndServe(timeout time.Duration) (Message, error) {
422
422
return nil , errorf ("could not get headers for inbound header request: %v" , err )
423
423
}
424
424
resp := & BlockHeaders {
425
- RequestId : msg .ReqID (),
426
- BlockHeadersPacket : eth .BlockHeadersPacket (headers ),
425
+ RequestId : msg .ReqID (),
426
+ BlockHeadersRequest : eth .BlockHeadersRequest (headers ),
427
427
}
428
428
if _ , err := c .Write (resp ); err != nil {
429
429
return nil , errorf ("could not write to connection: %v" , err )
@@ -455,7 +455,7 @@ func (c *Conn) headersRequest(request *GetBlockHeaders, reqID uint64) ([]*types.
455
455
if ! ok {
456
456
return nil , fmt .Errorf ("unexpected message received: %s" , pretty .Sdump (msg ))
457
457
}
458
- headers := []* types.Header (resp .BlockHeadersPacket )
458
+ headers := []* types.Header (resp .BlockHeadersRequest )
459
459
return headers , nil
460
460
}
461
461
0 commit comments