diff --git a/libbitdht/src/bitdht/bdconnection.cc b/libbitdht/src/bitdht/bdconnection.cc index a4b539181..36c5889fc 100644 --- a/libbitdht/src/bitdht/bdconnection.cc +++ b/libbitdht/src/bitdht/bdconnection.cc @@ -538,7 +538,10 @@ void bdConnectManager::updatePotentialConnectionProxy(const bdId *id, uint32_t m if (mode & BITDHT_PEER_STATUS_DHT_ENGINE_VERSION) { #ifdef DEBUG_NODE_CONNECTION - std::cerr << "bdConnectManager::updatePotentialConnectionProxy() Peer is GOOD, checking Connection Requests"; + std::cerr << "bdConnectManager::updatePotentialConnectionProxy() Peer is GOOD : "; + bdStdPrintId(std::cerr, id); + std::cerr << std::endl; + std::cerr << "bdConnectManager::updatePotentialConnectionProxy() checking Connection Requests"; std::cerr << std::endl; #endif /* good peer, see if any of our connectionrequests can use it */ diff --git a/libbitdht/src/bitdht/bdmanager.cc b/libbitdht/src/bitdht/bdmanager.cc index 3fc51c471..0b43d762e 100644 --- a/libbitdht/src/bitdht/bdmanager.cc +++ b/libbitdht/src/bitdht/bdmanager.cc @@ -377,10 +377,16 @@ void bdNodeManager::iteration() std::cerr << std::endl; #endif - status(); + status(); /* calculates mNetworkSize */ mAccount.printStats(std::cerr); + /* Finally, Fail, and restart if we lose all peers */ + if (mNetworkSize < MIN_OP_SPACE_SIZE) + { + mMode = BITDHT_MGR_STATE_FAILED; + mModeTS = now; + } } break; @@ -423,7 +429,7 @@ void bdNodeManager::iteration() * should use fn calls into their functions for good generality */ -#define RANDOM_SEARCH_FRAC (0.2) +#define RANDOM_SEARCH_FRAC (0.1) int bdNodeManager::QueryRandomLocalNet() {