Commit 077491c6 authored by jan.koester's avatar jan.koester
Browse files

test

parent 694e833b
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -224,6 +224,7 @@ private:
    std::unique_ptr<netplus::quic> socket_;
    std::atomic<bool> running_{false};
    std::atomic<bool> rebuilding_{false};
    std::atomic<bool> degraded_{false};  // true when startup peer wait timed out
    peer_status_fn peer_status_fn_;

    // Peer rebuild config
+7 −0
Original line number Diff line number Diff line
@@ -868,6 +868,10 @@ void server::run() {
                }
            } catch (...) {}
        }

        if (!peer_found) {
            degraded_ = true;
        }
    }

    // Auto-rebuild: sync missing blocks from peers on startup
@@ -1139,6 +1143,9 @@ void server::process_message(netplus::quic& conn, uint64_t stream_id,
            // Determine status from peer connectivity
            if (info.peers_total > 0 && info.peers_online < info.peers_total) {
                info.status = node_status::DEGRADED;
            } else if (degraded_) {
                // Startup peer wait timed out — running without peers
                info.status = node_status::DEGRADED;
            } else {
                info.status = node_status::OK;
            }