aboutsummaryrefslogtreecommitdiff
path: root/src/blockfilter.h
diff options
context:
space:
mode:
authorJim Posen <jim.posen@gmail.com>2018-08-27 15:42:35 -0700
committerJim Posen <jim.posen@gmail.com>2019-04-06 12:03:21 -0700
commitba6ff9a6f70139594362b4b4a6b816707bb165c8 (patch)
treebfd72dd218f42fd57a402cb9dece4d56ab1e9659 /src/blockfilter.h
parent62b7a4f09409f60a35fc99ddb70f9199ac511a53 (diff)
downloadbitcoin-ba6ff9a6f70139594362b4b4a6b816707bb165c8.tar.xz
blockfilter: Functions to translate filter types to/from names.
Diffstat (limited to 'src/blockfilter.h')
-rw-r--r--src/blockfilter.h7
1 files changed, 7 insertions, 0 deletions
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 <stdint.h>
+#include <string>
#include <unordered_set>
#include <vector>
@@ -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.