mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-04-21 12:18:13 +02:00
Merge bitcoin/bitcoin#23380: addrman: Fix AddrMan::Add() return semantics and logging
61ec0539b2[MOVEONLY] reorder functions in addrman_impl.h and addrman.cpp (John Newbery)2095df7b7b[addrman] Add Add_() inner function, fix Add() return semantics (John Newbery)2658eb6d68[addrman] Rename Add_() to AddSingle() (John Newbery)e58598e833[addrman] Add doxygen comment to AddrMan::Add() (John Newbery) Pull request description: Previously, Add() would return true if the function created a new AddressInfo object, even if that object could not be successfully entered into the new table and was deleted. That would happen if the new table position was already taken and the existing entry could not be removed. Instead, return true if the new AddressInfo object is successfully entered into the new table. This fixes a bug in the "Added %i addresses" log, which would not always accurately log how many addresses had been added. ACKs for top commit: naumenkogs: ACK61ec0539b2mzumsande: ACK61ec0539b2shaavan: ACK61ec0539b2Tree-SHA512: 276f1e8297d4b6d411d05d06ffc7c176f6290a784da039926ab6c471a8ed8e9159ab4f56c893b1285737ae292954930f0d28012d89dfb3f2f825d7df41016feb
This commit is contained in:
@@ -152,7 +152,6 @@ class AddrTest(BitcoinTestFramework):
|
||||
msg = self.setup_addr_msg(num_ipv4_addrs)
|
||||
with self.nodes[0].assert_debug_log(
|
||||
[
|
||||
'Added {} addresses from 127.0.0.1: 0 tried'.format(num_ipv4_addrs),
|
||||
'received: addr (301 bytes) peer=1',
|
||||
]
|
||||
):
|
||||
|
||||
@@ -72,9 +72,6 @@ class AddrTest(BitcoinTestFramework):
|
||||
addr_receiver = self.nodes[0].add_p2p_connection(AddrReceiver())
|
||||
msg.addrs = ADDRS
|
||||
with self.nodes[0].assert_debug_log([
|
||||
# The I2P address is not added to node's own addrman because it has no
|
||||
# I2P reachability (thus 10 - 1 = 9).
|
||||
'Added 9 addresses from 127.0.0.1: 0 tried',
|
||||
'received: addrv2 (159 bytes) peer=0',
|
||||
'sending addrv2 (159 bytes) peer=1',
|
||||
]):
|
||||
|
||||
Reference in New Issue
Block a user