blockfilter: Functions to translate filter types to/from names.

This commit is contained in:
Jim Posen
2018-08-27 15:42:35 -07:00
parent 62b7a4f094
commit ba6ff9a6f7
3 changed files with 40 additions and 0 deletions

View File

@@ -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.