From 6919c823cbce92248647880fb1d912828449ae57 Mon Sep 17 00:00:00 2001 From: Russell Yanofsky Date: Tue, 31 Aug 2021 09:59:12 -0400 Subject: MOVEONLY: Expose BanMapToJson / BanMapFromJson CSubNet serialization code that was removed in fa4e6afdae7b82df638b60edf37ac36d57a8cb4f was needed by multiprocess code to share ban map between gui and node processes. Rather than adding it back, use suggestion from MarcoFalke https://github.com/bitcoin/bitcoin/pull/10102#discussion_r690922929 to use JSON serialization. This requires making BanMapToJson / BanMapFromJson functions public. --- src/addrdb.h | 27 --------------------------- 1 file changed, 27 deletions(-) (limited to 'src/addrdb.h') diff --git a/src/addrdb.h b/src/addrdb.h index 26400ee0b6..26b1c5880f 100644 --- a/src/addrdb.h +++ b/src/addrdb.h @@ -16,33 +16,6 @@ class CAddress; class CAddrMan; class CDataStream; -class CBanEntry -{ -public: - static constexpr int CURRENT_VERSION{1}; - int nVersion{CBanEntry::CURRENT_VERSION}; - int64_t nCreateTime{0}; - int64_t nBanUntil{0}; - - CBanEntry() {} - - explicit CBanEntry(int64_t nCreateTimeIn) - : nCreateTime{nCreateTimeIn} {} - - /** - * Create a ban entry from JSON. - * @param[in] json A JSON representation of a ban entry, as created by `ToJson()`. - * @throw std::runtime_error if the JSON does not have the expected fields. - */ - explicit CBanEntry(const UniValue& json); - - /** - * Generate a JSON representation of this ban entry. - * @return JSON suitable for passing to the `CBanEntry(const UniValue&)` constructor. - */ - UniValue ToJson() const; -}; - /** Access to the (IP) address database (peers.dat) */ class CAddrDB { -- cgit v1.2.3