X-Git-Url: https://git.novaco.in/?a=blobdiff_plain;f=src%2Fscript.h;h=a5a1e1868c9cb9097ee8ebda5df1c309ff09eafb;hb=bf798734db4539a39edd6badf54a1c3aecf193e5;hp=e61ea2fd7eb7280f750dd7b75da46ba20f40a0cf;hpb=1466b8b78ad8cabf93ac3f65f5929213c5dd3c8f;p=novacoin.git diff --git a/src/script.h b/src/script.h index e61ea2f..a5a1e18 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 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& keys); + void SetMultisigOr(const std::vector& keys); + void SetMultisigEscrow(const std::vector& keys); void PrintHex() const