mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2025-01-06 11:02:18 +00:00
fix nil pointer on error
This commit is contained in:
parent
a3431f5663
commit
c8a357c673
@ -101,9 +101,9 @@ func (f *Send) BroadcastLocalPooledTxs(txs Hashes) (sentToPeers int) {
|
|||||||
peers, err := sentryClient.SendMessageToAll(f.ctx, req65, &grpc.EmptyCallOption{})
|
peers, err := sentryClient.SendMessageToAll(f.ctx, req65, &grpc.EmptyCallOption{})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Warn("[txpool.send] BroadcastLocalPooledTxs", "err", err)
|
log.Warn("[txpool.send] BroadcastLocalPooledTxs", "err", err)
|
||||||
|
} else {
|
||||||
|
avgPeersPerSent65 += len(peers.Peers)
|
||||||
}
|
}
|
||||||
avgPeersPerSent65 += len(peers.Peers)
|
|
||||||
|
|
||||||
case direct.ETH66:
|
case direct.ETH66:
|
||||||
if req66 == nil {
|
if req66 == nil {
|
||||||
req66 = &sentry.OutboundMessageData{
|
req66 = &sentry.OutboundMessageData{
|
||||||
@ -114,8 +114,9 @@ func (f *Send) BroadcastLocalPooledTxs(txs Hashes) (sentToPeers int) {
|
|||||||
peers, err := sentryClient.SendMessageToAll(f.ctx, req66, &grpc.EmptyCallOption{})
|
peers, err := sentryClient.SendMessageToAll(f.ctx, req66, &grpc.EmptyCallOption{})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Warn("[txpool.send] BroadcastLocalPooledTxs", "err", err)
|
log.Warn("[txpool.send] BroadcastLocalPooledTxs", "err", err)
|
||||||
|
} else {
|
||||||
|
avgPeersPerSent66 += len(peers.Peers)
|
||||||
}
|
}
|
||||||
avgPeersPerSent66 += len(peers.Peers)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user