Exit RelayTransaction early if we have no nodes to relay to
This commit is contained in:
@@ -2109,6 +2109,12 @@ void RelayTransaction(const CTransaction& tx, const CDataStream& ss)
|
|||||||
|
|
||||||
auto vRelayNodes = vNodes;
|
auto vRelayNodes = vNodes;
|
||||||
|
|
||||||
|
// If we have no nodes to relay to, there is nothing to do
|
||||||
|
if(vNodes.size() == 0) {
|
||||||
|
fprintf(stderr, "%s: No nodes to relay to!\n", __func__ );
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// We always round down, except when we have only 1 connection
|
// We always round down, except when we have only 1 connection
|
||||||
auto newSize = (vNodes.size() / 2) == 0 ? 1 : (vNodes.size() / 2);
|
auto newSize = (vNodes.size() / 2) == 0 ? 1 : (vNodes.size() / 2);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user