From ba50fce5b88aaf6f469102a74aadb1d2793e4754 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 22 Oct 2017 19:06:28 +0300 Subject: [PATCH] Test --- iguana/exchanges/LP_network.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index 45307bedf..10d0cd7ca 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -242,6 +242,10 @@ printf("Q sent1 %u msglen.%d (%s)\n",crc32,msglen,msg); peerind = (rand() % maxind); else peerind = 0; sock0 = LP_peerindsock(&peerind); + if ( (maxind= LP_numpeers()) > 0 ) + peerind = (rand() % maxind); + else peerind = 0; + sock1 = LP_peerindsock(&peerind); } if ( sock0 >= 0 ) _LP_sendqueueadd(crc32,sock0,msg,msglen,needack * peerind);