mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-09-12 21:52:53 +02:00
90ce21e21drpc: reject empty node argument in addnode (w0xlt)69465de447init: ignore empty addnode values (w0xlt) Pull request description: An empty `addnode=` entry currently creates an empty added-node record. The node then repeatedly attempts to connect to the empty destination: ```text 2026-07-23T19:22:33Z [net] trying v2 connection (manual) to , lastseen=0.0hrs 2026-07-23T19:23:33Z [net] trying v2 connection (manual) to , lastseen=0.0hrs 2026-07-23T19:24:34Z [net] trying v2 connection (manual) to , lastseen=0.0hrs ``` With this change, the node ignores empty `-addnode` values when initializing the connection manager. This preserves the existing startup behavior while avoiding useless connection attempts. Non-empty values are unaffected. Values consisting only of whitespace are ignored as well, and every ignored value is logged. The `addnode` RPC has the same issue, so it now returns `Error: Node address cannot be empty` instead of adding such a record. Functional tests verify that the node starts with `addnode=`, that no added-node record is created while non-empty values are still added, and that the RPC rejects empty values. ACKs for top commit: l0rinc: lightly tested ACK90ce21e21dachow101: ACK90ce21e21dpablomartin4btc: ACK90ce21e21dfurszy: utACK90ce21e21dTree-SHA512: e3074ff8a4e477f12c1f3331bc941854c2c994290afca85d4695a2ade79d0f230d167aaa9a141e619415164a853c54b7225477d0df8e5b96e0f1480223e188e5