From ba6ff9a6f70139594362b4b4a6b816707bb165c8 Mon Sep 17 00:00:00 2001 From: Jim Posen Date: Mon, 27 Aug 2018 15:42:35 -0700 Subject: blockfilter: Functions to translate filter types to/from names. --- src/blockfilter.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/blockfilter.h') diff --git a/src/blockfilter.h b/src/blockfilter.h index e5e087ed5a..7a219ff22b 100644 --- a/src/blockfilter.h +++ b/src/blockfilter.h @@ -6,6 +6,7 @@ #define BITCOIN_BLOCKFILTER_H #include +#include #include #include @@ -89,6 +90,12 @@ enum class BlockFilterType : uint8_t INVALID = 255, }; +/** Get the human-readable name for a filter type. Returns empty string for unknown types. */ +const std::string& BlockFilterTypeName(BlockFilterType filter_type); + +/** Find a filter type by its human-readable name. */ +bool BlockFilterTypeByName(const std::string& name, BlockFilterType& filter_type); + /** * Complete block filter struct as defined in BIP 157. Serialization matches * payload of "cfilter" messages. -- cgit v1.2.3