Skip to content

Commit 4213d9a

Browse files
committed
go/p2p/rpc: Make CallMulti fail if 0 peers
1 parent 7e6e3a2 commit 4213d9a

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

go/p2p/rpc/client.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -364,6 +364,10 @@ func (c *client) CallMulti(
364364
) ([]any, []PeerFeedback, error) {
365365
c.logger.Debug("call multiple", "method", method)
366366

367+
if len(peers) == 0 {
368+
return nil, nil, fmt.Errorf("no peers given to service the request")
369+
}
370+
367371
co := NewCallMultiOptions(opts...)
368372

369373
// Prepare the request.

0 commit comments

Comments
 (0)