Changeset View
Changeset View
Standalone View
Standalone View
src/script/script.h
Show First 20 Lines • Show All 625 Lines • ▼ Show 20 Lines | public: | ||||
} | } | ||||
void clear() { | void clear() { | ||||
// The default std::vector::clear() does not release memory. | // The default std::vector::clear() does not release memory. | ||||
CScriptBase().swap(*this); | CScriptBase().swap(*this); | ||||
} | } | ||||
}; | }; | ||||
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<uint8_t>> stack; | |||||
// Some compilers complain without a default constructor | |||||
CScriptWitness() {} | |||||
bool IsNull() const { return stack.empty(); } | |||||
void SetNull() { | |||||
stack.clear(); | |||||
stack.shrink_to_fit(); | |||||
} | |||||
std::string ToString() const; | |||||
}; | |||||
class CReserveScript { | class CReserveScript { | ||||
public: | public: | ||||
CScript reserveScript; | CScript reserveScript; | ||||
virtual void KeepScript() {} | virtual void KeepScript() {} | ||||
CReserveScript() {} | CReserveScript() {} | ||||
virtual ~CReserveScript() {} | virtual ~CReserveScript() {} | ||||
}; | }; | ||||
#endif // BITCOIN_SCRIPT_SCRIPT_H | #endif // BITCOIN_SCRIPT_SCRIPT_H |