diff --git a/src/net.cpp b/src/net.cpp index 7df4f5e90..40e5070de 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -2109,6 +2109,12 @@ void RelayTransaction(const CTransaction& tx, const CDataStream& ss) 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 auto newSize = (vNodes.size() / 2) == 0 ? 1 : (vNodes.size() / 2);