aboutsummaryrefslogtreecommitdiff
path: root/src/addrdb.cpp
diff options
context:
space:
mode:
authorHennadii Stepanov <32963518+hebasto@users.noreply.github.com>2020-09-12 17:59:09 +0300
committerHennadii Stepanov <32963518+hebasto@users.noreply.github.com>2020-10-09 14:28:58 +0300
commit567008d2a0c95bd972f4031f31647c493d1bc2e8 (patch)
tree8edcb1f8123c9bd70f736f15258be22316d148db /src/addrdb.cpp
parent12a1c3ad1a43634d2a98717e49e3f02c4acea2fe (diff)
p2p: Add DumpAnchors()
Diffstat (limited to 'src/addrdb.cpp')
-rw-r--r--src/addrdb.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/addrdb.cpp b/src/addrdb.cpp
index f3e8a19de2..ca2d66570b 100644
--- a/src/addrdb.cpp
+++ b/src/addrdb.cpp
@@ -10,6 +10,7 @@
#include <clientversion.h>
#include <cstdint>
#include <hash.h>
+#include <logging/timer.h>
#include <random.h>
#include <streams.h>
#include <tinyformat.h>
@@ -156,3 +157,9 @@ bool CAddrDB::Read(CAddrMan& addr, CDataStream& ssPeers)
}
return ret;
}
+
+void DumpAnchors(const fs::path& anchors_db_path, const std::vector<CAddress>& anchors)
+{
+ LOG_TIME_SECONDS(strprintf("Flush %d outbound block-relay-only peer addresses to anchors.dat", anchors.size()));
+ SerializeFileDB("anchors", anchors_db_path, anchors);
+}