diff options
author | Vasil Dimov <vd@FreeBSD.org> | 2021-01-14 09:33:04 +0100 |
---|---|---|
committer | Vasil Dimov <vd@FreeBSD.org> | 2021-06-21 14:39:44 +0200 |
commit | d197977ae2076903ed12ab7616a7f93e88be02e1 (patch) | |
tree | f52c91c3abad65cffa13a8334c37da415c708c70 /src/banman.h | |
parent | 6a67366fdc3e1d383fe7cbfa209d7e85f0d96638 (diff) |
banman: save the banlist in a JSON format on disk
Save the banlist in `banlist.json` instead of `banlist.dat`.
This makes it possible to store Tor v3 entries in the banlist on disk
(and any other addresses that cannot be serialized in addrv1 format).
Only read `banlist.dat` if it exists and `banlist.json` does not
exist (first start after an upgrade).
Supersedes https://github.com/bitcoin/bitcoin/pull/20904
Resolves https://github.com/bitcoin/bitcoin/issues/19748
Diffstat (limited to 'src/banman.h')
-rw-r--r-- | src/banman.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/banman.h b/src/banman.h index f6bfbd1e49..8c75d4037e 100644 --- a/src/banman.h +++ b/src/banman.h @@ -17,7 +17,8 @@ // NOTE: When adjusting this, update rpcnet:setban's help ("24h") static constexpr unsigned int DEFAULT_MISBEHAVING_BANTIME = 60 * 60 * 24; // Default 24-hour ban -// How often to dump addresses to banlist.dat + +/// How often to dump banned addresses/subnets to disk. static constexpr std::chrono::minutes DUMP_BANS_INTERVAL{15}; class CClientUIInterface; @@ -30,7 +31,7 @@ class CSubNet; // If an address or subnet is banned, we never accept incoming connections from // it and never create outgoing connections to it. We won't gossip its address // to other peers in addr messages. Banned addresses and subnets are stored to -// banlist.dat on shutdown and reloaded on startup. Banning can be used to +// disk on shutdown and reloaded on startup. Banning can be used to // prevent connections with spy nodes or other griefers. // // 2. Discouragement. If a peer misbehaves enough (see Misbehaving() in @@ -79,7 +80,6 @@ public: void DumpBanlist(); private: - void SetBanned(const banmap_t& banmap); bool BannedSetIsDirty(); //!set the "dirty" flag for the banlist void SetBannedSetDirty(bool dirty = true); |