check TxMsg
- add validation on TxMsg checking for nil - add test for nil transaction - add test for zero value transaction (no extra validation needed)
This commit is contained in:
@ -185,7 +185,10 @@ func (self *ethProtocol) handle() error {
|
||||
if err := msg.Decode(&txs); err != nil {
|
||||
return self.protoError(ErrDecode, "msg %v: %v", msg, err)
|
||||
}
|
||||
for _, tx := range txs {
|
||||
for i, tx := range txs {
|
||||
if tx == nil {
|
||||
return self.protoError(ErrDecode, "transaction %d is nil", i)
|
||||
}
|
||||
jsonlogger.LogJson(&logger.EthTxReceived{
|
||||
TxHash: tx.Hash().Hex(),
|
||||
RemoteId: self.peer.ID().String(),
|
||||
|
Reference in New Issue
Block a user