diff options
| author | Gavin Andresen <[email protected]> | 2011-09-28 12:30:06 -0400 |
|---|---|---|
| committer | Gavin Andresen <[email protected]> | 2011-12-19 12:40:19 -0500 |
| commit | bf798734db4539a39edd6badf54a1c3aecf193e5 (patch) | |
| tree | 850f60c149335de2c85c0aafd10a8fc50aca9c7e /src/script.h | |
| parent | Rework unit tests so test_bitcoin.cpp does not #include them all (diff) | |
| download | discoin-bf798734db4539a39edd6badf54a1c3aecf193e5.tar.xz discoin-bf798734db4539a39edd6badf54a1c3aecf193e5.zip | |
Support 3 new multisignature IsStandard transactions
Initial support for (a and b), (a or b), and 2-of-3 escrow
transactions (where a, b, and c are keys).
Diffstat (limited to 'src/script.h')
| -rw-r--r-- | src/script.h | 25 |
1 files changed, 10 insertions, 15 deletions
diff --git a/src/script.h b/src/script.h index e61ea2fd7..a5a1e1868 100644 --- a/src/script.h +++ b/src/script.h @@ -574,6 +574,13 @@ public: return true; } + static int DecodeOP_N(opcodetype opcode) + { + if (opcode == OP_0) + return 0; + assert(opcode >= OP_1 && opcode <= OP_16); + return (int)opcode - (int)(OP_1 - 1); + } void FindAndDelete(const CScript& b) { @@ -625,21 +632,6 @@ public: } - CBitcoinAddress GetBitcoinAddress() const - { - opcodetype opcode; - std::vector<unsigned char> vch; - CScript::const_iterator pc = begin(); - if (!GetOp(pc, opcode, vch) || opcode != OP_DUP) return 0; - if (!GetOp(pc, opcode, vch) || opcode != OP_HASH160) return 0; - if (!GetOp(pc, opcode, vch) || vch.size() != sizeof(uint160)) return 0; - uint160 hash160 = uint160(vch); - if (!GetOp(pc, opcode, vch) || opcode != OP_EQUALVERIFY) return 0; - if (!GetOp(pc, opcode, vch) || opcode != OP_CHECKSIG) return 0; - if (pc != end()) return 0; - return CBitcoinAddress(hash160); - } - void SetBitcoinAddress(const CBitcoinAddress& address) { this->clear(); @@ -650,6 +642,9 @@ public: { SetBitcoinAddress(CBitcoinAddress(vchPubKey)); } + void SetMultisigAnd(const std::vector<CKey>& keys); + void SetMultisigOr(const std::vector<CKey>& keys); + void SetMultisigEscrow(const std::vector<CKey>& keys); void PrintHex() const |