Fix unknown block response nil pointer on client

This commit is contained in:
DataHoarder 2023-04-19 19:35:13 +02:00
parent fa52d8c44a
commit c9982a77cb
Signed by: DataHoarder
SSH key fingerprint: SHA256:OLTRf6Fl87G52SiR7sWLGNzlJt4WOX+tfI2yxo0z7xk

View file

@ -412,6 +412,7 @@ func (c *Client) OnConnection() {
} else if blockSize == 0 {
//NOT found
//TODO log
break
} else {
if err = block.FromReader(c.Owner.Consensus(), c.Owner.SideChain().DerivationCache(), bufio.NewReader(io.LimitReader(c, int64(blockSize)))); err != nil {
//TODO warn
@ -461,6 +462,7 @@ func (c *Client) OnConnection() {
} else if blockSize == 0 {
//NOT found
//TODO log
break
} else if messageId == MessageBlockBroadcastCompact {
if err = block.FromCompactReader(c.Owner.Consensus(), c.Owner.SideChain().DerivationCache(), bufio.NewReader(io.LimitReader(c, int64(blockSize)))); err != nil {
//TODO warn