| 465 | } |
| 466 | |
| 467 | void PushAddress(const CAddress& addr) |
| 468 | { |
| 469 | // Known checking here is only to save space from duplicates. |
| 470 | // SendMessages will filter it again for knowns that were added |
| 471 | // after addresses were pushed. |
| 472 | if (addr.IsValid() && !setAddrKnown.count(addr)) { |
| 473 | if (vAddrToSend.size() >= MAX_ADDR_TO_SEND) { |
| 474 | vAddrToSend[insecure_rand() % vAddrToSend.size()] = addr; |
| 475 | } else { |
| 476 | vAddrToSend.push_back(addr); |
| 477 | } |
| 478 | } |
| 479 | } |
| 480 | |
| 481 | |
| 482 | void AddInventoryKnown(const CInv& inv) |
no test coverage detected