mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-18 13:17:55 +02:00
Add CScript::PushWithdraw function
This commit is contained in:
parent
8c121ccd5c
commit
3e5d2fe86a
2 changed files with 17 additions and 0 deletions
|
|
@ -336,6 +336,20 @@ COutPoint CScript::GetWithdrawSpent() const
|
|||
}
|
||||
}
|
||||
|
||||
void CScript::PushWithdraw(const vector<unsigned char> push) {
|
||||
int64_t pushCount = 0;
|
||||
for (vector<unsigned char>::const_iterator it = push.begin(); it < push.end(); pushCount++) {
|
||||
if (push.end() - it < 520) {
|
||||
*this << vector<unsigned char>(it, push.end());
|
||||
it = push.end();
|
||||
} else {
|
||||
*this << vector<unsigned char>(it, it + 520);
|
||||
it += 520;
|
||||
}
|
||||
}
|
||||
*this << pushCount;
|
||||
}
|
||||
|
||||
bool CScript::IsPayToScriptHash() const
|
||||
{
|
||||
// Extra-fast test for pay-to-script-hash CScripts:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue