diff options
Diffstat (limited to 'src/script')
-rw-r--r-- | src/script/script.cpp | 12 | ||||
-rw-r--r-- | src/script/script.h | 14 |
2 files changed, 26 insertions, 0 deletions
diff --git a/src/script/script.cpp b/src/script/script.cpp index 9f2809e593..6b1eb52bbf 100644 --- a/src/script/script.cpp +++ b/src/script/script.cpp @@ -231,3 +231,15 @@ bool CScript::IsPushOnly() const { return this->IsPushOnly(begin()); } + +std::string CScriptWitness::ToString() const +{ + std::string ret = "CScriptWitness("; + for (unsigned int i = 0; i < stack.size(); i++) { + if (i) { + ret += ", "; + } + ret += HexStr(stack[i]); + } + return ret + ")"; +} diff --git a/src/script/script.h b/src/script/script.h index a2941ce901..0b6d822d81 100644 --- a/src/script/script.h +++ b/src/script/script.h @@ -643,6 +643,20 @@ public: } }; +struct CScriptWitness +{ + // Note that this encodes the data elements being pushed, rather than + // encoding them as a CScript that pushes them. + std::vector<std::vector<unsigned char> > stack; + + // Some compilers complain without a default constructor + CScriptWitness() { } + + bool IsNull() const { return stack.empty(); } + + std::string ToString() const; +}; + class CReserveScript { public: |