mirror of
https://github.com/bitcoin/bitcoin.git
synced 2024-11-20 02:25:40 +01:00
rpc: make addpeeraddress work with cjdns addresses
This allows us to add cjdns addresses to addrman for testing and debug purposes (if -cjdnsreachable is true)
This commit is contained in:
parent
a8a9ed67cc
commit
68209a7b5c
@ -164,6 +164,7 @@ bool SeenLocal(const CService& addr);
|
||||
bool IsLocal(const CService& addr);
|
||||
bool GetLocal(CService &addr, const CNetAddr *paddrPeer = nullptr);
|
||||
CService GetLocalAddress(const CNetAddr& addrPeer);
|
||||
CService MaybeFlipIPv6toCJDNS(const CService& service);
|
||||
|
||||
|
||||
extern bool fDiscover;
|
||||
|
@ -947,7 +947,8 @@ static RPCHelpMan addpeeraddress()
|
||||
bool success{false};
|
||||
|
||||
if (LookupHost(addr_string, net_addr, false)) {
|
||||
CAddress address{{net_addr, port}, ServiceFlags{NODE_NETWORK | NODE_WITNESS}};
|
||||
CService service{net_addr, port};
|
||||
CAddress address{MaybeFlipIPv6toCJDNS(service), ServiceFlags{NODE_NETWORK | NODE_WITNESS}};
|
||||
address.nTime = Now<NodeSeconds>();
|
||||
// The source address is set equal to the address. This is equivalent to the peer
|
||||
// announcing itself.
|
||||
|
Loading…
Reference in New Issue
Block a user