Move mapFlagNames and FormatScriptFlags logic to script/interpreter.h

Moves FormatScriptFlags logic into GetScriptFlagNames which returns a
vector of strings. For completeness, also has GetScriptFlagNames report
on any bits that do not match a known script flag.
This commit is contained in:
Anthony Towns
2022-09-14 13:15:42 +10:00
parent 9b1a7c3e8d
commit 5db8cd2d37
5 changed files with 74 additions and 42 deletions

View File

@@ -371,4 +371,8 @@ size_t CountWitnessSigOps(const CScript& scriptSig, const CScript& scriptPubKey,
int FindAndDelete(CScript& script, const CScript& b);
extern const std::map<std::string, uint32_t> g_verify_flag_names;
std::vector<std::string> GetScriptFlagNames(uint32_t flags);
#endif // BITCOIN_SCRIPT_INTERPRETER_H