Support sending to script (P2SH) addresses

Upstream partials from 9e470585b3, e679ec969c, and 922e8e2929.
This commit is contained in:
Luke Dashjr
2012-08-26 22:43:42 +00:00
parent bfd2ddfc47
commit 01cc7bf0c5
2 changed files with 22 additions and 1 deletions
+4 -1
View File
@@ -654,7 +654,10 @@ public:
void SetBitcoinAddress(const CBitcoinAddress& address)
{
this->clear();
*this << OP_DUP << OP_HASH160 << address.GetHash160() << OP_EQUALVERIFY << OP_CHECKSIG;
if (address.IsScript())
*this << OP_HASH160 << address.GetHash160() << OP_EQUAL;
else
*this << OP_DUP << OP_HASH160 << address.GetHash160() << OP_EQUALVERIFY << OP_CHECKSIG;
}
void SetBitcoinAddress(const std::vector<unsigned char>& vchPubKey)