Commit Graph
10 Commits
Author SHA1 Message Date
dcrubro 3e5c051645 Change functions IsValidIPv4/v6 to use addrinfo instead of custom logic 2026-07-27 12:28:34 +02:00
dcrubro c4e28df46f Fix txpooldetail command not working, add missing commands to list, fix connect command for ipv6 2026-07-27 12:22:43 +02:00
dcrubro 21fe73fb01 Add NodeDiscovery: multi-hop peer crawl with UDP-ping preference
- Implement NodeDiscovery engine: known-peer table (DynArr) with a
  per-tick seed/ping/query/connect state machine driven by the node
  maintenance thread; bounded multi-hop crawl (FANOUT peers per node,
  hop-capped) that connects to reachable peers lowest-ping-first
- Add GET_PEERS/PEERS TCP opcodes for peer-list exchange, handled on
  both inbound and outbound connections
- Measure UDP round-trip time and pass it to the on_pong callback
  (previously the send timestamp was only used for retries)
- Advertise each node's listen port in HELLO/ACK_HELLO and store it
  per-connection, so inbound-only peers and non-default ports are
  discoverable (length-guarded parse; wire-compatible with old peers)
- Wire a udp_node_t + node_discovery_t into net_node_t: init/start in
  Node_Create, tick in the maintenance loop, teardown in Node_Destroy
  (stop UDP before destroying discovery to avoid callback races)
- Add Node_ConnListenEndpoint / Node_GetPeerEndpoints helpers to derive
  peers' listen endpoints (outbound: dialed port; inbound: advertised),
  with IPv4-mapped-IPv6 normalization and IP+port dedup
- Match ping pong/timeout callbacks by peer address (the UDP layer owns
  the nonce), fixing discovered peers stuck UNREACHABLE
- Ping the peer's listen port instead of the ephemeral TCP source port
  (fixes the original stub so pongs actually return)
- Add `peers` CLI command to dump the discovery table (endpoint/hop/
  state/ping)
- Add discovery tunables to constants.h (fanout, max hops, target
  connections, timeouts, caps)
2026-07-22 23:18:57 +02:00
dcrubro 4cfe85f6f2 orphans and wallet files 2026-05-28 13:01:23 +02:00
dcrubro 644695c018 linux errors 2026-05-15 16:07:16 +02:00
dcrubro 318fecc029 millisecond timestamps 2026-05-03 13:58:06 +02:00
dcrubro d4ec88426a blockdetail command, fullverify checks difficulty (needs optimizing), move general functions to utils.h 2026-04-30 00:09:40 +02:00
dcrubro bd972bfab6 hello and ack exchange 2026-04-25 20:28:38 +02:00
dcrubro 32b9a57366 tx mempool start, hello packet 2026-04-24 17:14:40 +02:00
dcrubro accdeebee8 'balance all' command 2026-04-23 22:10:14 +02:00