services: support 0.0.0.0/:: in address options

Previously, client services didn't decode these special INADDR_ANY
addresses and failed to connect.
This commit is contained in:
Erik Arvstedt
2021-10-01 11:51:57 +02:00
parent 1848c3dd98
commit f61e928139
13 changed files with 36 additions and 23 deletions

View File

@@ -13,6 +13,7 @@ let
};
cfg = config.nix-bitcoin.nodeinfo;
nbLib = config.nix-bitcoin.lib;
# Services included in the output
services = {
@@ -96,7 +97,7 @@ let
mkInfo = extraCode: name: cfg:
''
add_service("${name}", """
info["local_address"] = "${cfg.address}:${toString cfg.port}"
info["local_address"] = "${nbLib.addressWithPort cfg.address cfg.port}"
'' + mkIfOnionPort name (onionPort: ''
set_onion_address(info, "${name}", ${onionPort})
'') + extraCode + ''