BIP144: Serialization, hashes, relay (sender side)
Contains refactorings by Eric Lombrozo. Contains fixup by Nicolas Dorier. Contains cleanup of CInv::GetCommand by Alex Morcos
This commit is contained in:
@@ -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 + ")";
|
||||
}
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user