mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-19 14:53:43 +01:00
refactor: Use type-safe std::chrono for addrman time
This commit is contained in:
@@ -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)) {
|
||||
|
||||
Reference in New Issue
Block a user