diff options
author | Amiti Uttarwar <amiti@uttarwar.org> | 2021-07-22 17:00:36 -0700 |
---|---|---|
committer | Amiti Uttarwar <amiti@uttarwar.org> | 2021-08-15 22:35:13 -0700 |
commit | 60e0cbdd574bb9109bcad1e0c27c7936a534a0e7 (patch) | |
tree | b3c49dced04e42234b507682e033706b99d12232 /src/test/net_tests.cpp | |
parent | 3facf0a8ae99a03f5e2fb709b8d86c47328d363c (diff) | |
download | bitcoin-60e0cbdd574bb9109bcad1e0c27c7936a534a0e7.tar.xz |
[addrman] Merge the two Add() functions
Merge the two definitions of this overloaded function to reduce code
duplication.
Diffstat (limited to 'src/test/net_tests.cpp')
-rw-r--r-- | src/test/net_tests.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/test/net_tests.cpp b/src/test/net_tests.cpp index 1915f9c7d5..9ac200cbc7 100644 --- a/src/test/net_tests.cpp +++ b/src/test/net_tests.cpp @@ -112,9 +112,9 @@ BOOST_AUTO_TEST_CASE(caddrdb_read) // Add three addresses to new table. CService source; BOOST_CHECK(Lookup("252.5.1.1", source, 8333, false)); - BOOST_CHECK(addrmanUncorrupted.Add(CAddress(addr1, NODE_NONE), source)); - BOOST_CHECK(addrmanUncorrupted.Add(CAddress(addr2, NODE_NONE), source)); - BOOST_CHECK(addrmanUncorrupted.Add(CAddress(addr3, NODE_NONE), source)); + std::vector<CAddress> addresses{CAddress(addr1, NODE_NONE), CAddress(addr2, NODE_NONE), CAddress(addr3, NODE_NONE)}; + BOOST_CHECK(addrmanUncorrupted.Add(addresses, source)); + BOOST_CHECK(addrmanUncorrupted.size() == 3); // Test that the de-serialization does not throw an exception. CDataStream ssPeers1 = AddrmanToStream(addrmanUncorrupted); |