Skip to content

Commit

Permalink
Handle unknown broadcasts
Browse files Browse the repository at this point in the history
  • Loading branch information
Djadih committed May 14, 2024
1 parent c1566b6 commit 97a2ac3
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion quai/p2p_backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ func (qbe *QuaiBackend) OnNewBroadcast(sourcePeer p2p.PeerID, topic string, data
// TODO: Determine if the block information was lively or stale and rate
// the peer accordingly
backend.WriteBlock(&data)
case types.Header:
case types.Transactions:
backend := *qbe.GetBackend(nodeLocation)
if backend == nil {
Expand All @@ -99,6 +98,10 @@ func (qbe *QuaiBackend) OnNewBroadcast(sourcePeer p2p.PeerID, topic string, data
if backend.ProcessingState() {
backend.SendRemoteTxs(data)
}
default:
// TODO: Remove panic and gracefully return
panic("not supposed to happen in dev environment")
return false
}

// If it was a good broadcast, mark the peer as lively
Expand Down

0 comments on commit 97a2ac3

Please sign in to comment.