mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-14 12:43:40 +02:00
refactor: Use type-safe std::chrono for addrman time
This commit is contained in:
parent
fa2ae373f3
commit
fa64dd6673
13 changed files with 164 additions and 153 deletions
|
|
@ -894,7 +894,7 @@ static RPCHelpMan getnodeaddresses()
|
|||
|
||||
for (const CAddress& addr : vAddr) {
|
||||
UniValue obj(UniValue::VOBJ);
|
||||
obj.pushKV("time", (int)addr.nTime);
|
||||
obj.pushKV("time", int64_t{TicksSinceEpoch<std::chrono::seconds>(addr.nTime)});
|
||||
obj.pushKV("services", (uint64_t)addr.nServices);
|
||||
obj.pushKV("address", addr.ToStringIP());
|
||||
obj.pushKV("port", addr.GetPort());
|
||||
|
|
@ -942,7 +942,7 @@ static RPCHelpMan addpeeraddress()
|
|||
|
||||
if (LookupHost(addr_string, net_addr, false)) {
|
||||
CAddress address{{net_addr, port}, ServiceFlags{NODE_NETWORK | NODE_WITNESS}};
|
||||
address.nTime = GetAdjustedTime();
|
||||
address.nTime = AdjustedTime();
|
||||
// The source address is set equal to the address. This is equivalent to the peer
|
||||
// announcing itself.
|
||||
if (node.addrman->Add({address}, address)) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue