feat: use DragonX DNS seed nodes, pass -maxconnections to daemon, show sync speed
- Replace hardcoded IP addnodes with node.dragonx.is, node1–4.dragonx.is in both daemon launch params and auto-generated DRAGONX.conf - Add max_connections setting (persisted, default 0 = daemon default); passed as -maxconnections= flag to dragonxd on startup - Show blocks/sec in status bar during sync with exponential smoothing (e.g. "Syncing 45.2% (12340 left, 85 blk/s)")
This commit is contained in:
@@ -205,7 +205,11 @@ std::vector<std::string> EmbeddedDaemon::getChainParams()
|
||||
"-ac_reward=300000000",
|
||||
"-ac_blocktime=36",
|
||||
"-ac_private=1",
|
||||
"-addnode=176.126.87.241",
|
||||
"-addnode=node.dragonx.is",
|
||||
"-addnode=node1.dragonx.is",
|
||||
"-addnode=node2.dragonx.is",
|
||||
"-addnode=node3.dragonx.is",
|
||||
"-addnode=node4.dragonx.is",
|
||||
"-experimentalfeatures",
|
||||
"-developerencryptwallet",
|
||||
dbcache_arg
|
||||
@@ -473,6 +477,11 @@ bool EmbeddedDaemon::start(const std::string& binary_path)
|
||||
args.push_back("-debug=" + cat);
|
||||
}
|
||||
|
||||
// Append max connections if configured (0 = daemon default)
|
||||
if (max_connections_ > 0) {
|
||||
args.push_back("-maxconnections=" + std::to_string(max_connections_));
|
||||
}
|
||||
|
||||
// Add -rescan flag if requested (one-shot)
|
||||
if (rescan_on_next_start_.exchange(false)) {
|
||||
DEBUG_LOGF("[INFO] Adding -rescan flag for blockchain rescan\n");
|
||||
|
||||
@@ -152,6 +152,11 @@ public:
|
||||
void setDebugCategories(const std::set<std::string>& cats) { debug_categories_ = cats; }
|
||||
const std::set<std::string>& getDebugCategories() const { return debug_categories_; }
|
||||
|
||||
/**
|
||||
* @brief Set maximum peer connections (0 = use daemon default)
|
||||
*/
|
||||
void setMaxConnections(int v) { max_connections_ = v; }
|
||||
|
||||
/**
|
||||
* @brief Request a blockchain rescan on the next daemon start
|
||||
*/
|
||||
@@ -194,6 +199,7 @@ private:
|
||||
std::thread monitor_thread_;
|
||||
std::atomic<bool> should_stop_{false};
|
||||
std::set<std::string> debug_categories_;
|
||||
int max_connections_ = 0; // 0 = daemon default
|
||||
std::atomic<int> crash_count_{0}; // consecutive crash counter
|
||||
std::atomic<bool> rescan_on_next_start_{false}; // -rescan flag for next start
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user