Ava Chow a6cdc3ec9b
Merge bitcoin/bitcoin#34303: test: addrman: test self-announcement time penalty handling
e770392084aa52e5568cf001da4d537fda1d71b3 test: addrman: test self-announcement time penalty handling (Bruno Garcia)

Pull request description:

  This PR adds a test case for addrman that verifies that addresses announcing themselves (addr == source) are exempt from time penalties, while addresses announced by others receive the expected penalty.

  It fixes the following mutant (https://corecheck.dev/mutation/src/addrman.cpp#L561):
  ```diff
  diff --git a/src/addrman.cpp b/src/addrman.cpp
  index 206b54118e..c6a045fd8d 100644
  --- a/src/addrman.cpp
  +++ b/src/addrman.cpp
  @@ -558,7 +558,7 @@ bool AddrManImpl::AddSingle(const CAddress& addr, const CNetAddr& source, std::c
       AddrInfo* pinfo = Find(addr, &nId);

       // Do not set a penalty for a source's self-announcement
  -    if (addr == source) {
  +    if (addr != source) {
           time_penalty = 0s;
       }
  ```

ACKs for top commit:
  maflcko:
    review ACK e770392084aa52e5568cf001da4d537fda1d71b3 🐤
  achow101:
    ACK e770392084aa52e5568cf001da4d537fda1d71b3
  fjahr:
    Code review ACK e770392084aa52e5568cf001da4d537fda1d71b3
  naiyoma:
    tACK e770392084aa52e5568cf001da4d537fda1d71b3

Tree-SHA512: ec029d1e1e979f91840af944984cad530a1ce9a0eceb123230817f0ef3b9ad47253eebc4c953d350de2d904b59496fcd4757123c8bd63cf0e09c3581da48fff8
2026-01-28 14:37:29 -08:00
..
2026-01-20 16:26:50 +00:00
2025-09-03 11:23:30 +01:00
2025-09-30 11:06:43 -07:00
2026-01-22 10:35:14 -05:00
2025-11-14 01:17:38 +02:00
2025-11-14 01:17:38 +02:00