diff options
author | NicolasDorier <nicolas.dorier@gmail.com> | 2016-04-10 15:59:23 +0900 |
---|---|---|
committer | Pieter Wuille <pieter.wuille@gmail.com> | 2016-06-22 15:43:01 +0200 |
commit | 745eb678ef5d52c74edcd9c322ebd1f3232a9310 (patch) | |
tree | fa08a8303b9f25efb19b5fa72cde264d276e2d48 /src/script/script.cpp | |
parent | f4691ab3a9d4f3321afa024984c03fe6e10bfdbc (diff) |
[RPC] signrawtransaction can sign P2WSH
Diffstat (limited to 'src/script/script.cpp')
-rw-r--r-- | src/script/script.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/script/script.cpp b/src/script/script.cpp index 73f5a61bf6..da551c23ee 100644 --- a/src/script/script.cpp +++ b/src/script/script.cpp @@ -210,6 +210,14 @@ bool CScript::IsPayToScriptHash() const (*this)[22] == OP_EQUAL); } +bool CScript::IsPayToWitnessScriptHash() const +{ + // Extra-fast test for pay-to-witness-script-hash CScripts: + return (this->size() == 34 && + (*this)[0] == OP_0 && + (*this)[1] == 0x20); +} + // A witness program is any valid CScript that consists of a 1-byte push opcode // followed by a data push between 2 and 40 bytes. bool CScript::IsWitnessProgram(int& version, std::vector<unsigned char>& program) const |