mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-19 06:43:45 +01:00
Merge bitcoin/bitcoin#24697: refactor address relay time
fa64dd6673refactor: Use type-safe std::chrono for addrman time (MarcoFalke)fa2ae373f3Add type-safe AdjustedTime() getter to timedata (MarcoFalke)fa5103a9f5Add ChronoFormatter to serialize (MarcoFalke)fa253d385futil: Add HoursDouble (MarcoFalke)fa21fc60c2scripted-diff: Rename addrman time symbols (MarcoFalke)fa9284c3e9refactor: Remove not needed std::max (MacroFake) Pull request description: Those refactors are overlapping with, but otherwise largely unrelated to #24662. ACKs for top commit: naumenkogs: utACKfa64dd6673dergoegge: Code review ACKfa64dd6673Tree-SHA512: a50625e78036e7220a11997e6d9b6c6b317cb38ce02b1835fb41cbee2d8bfb1faf29b29d8990be78d6b5e15e9a9d8dec33bf25fa439b47610ef708950969724b
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