aboutsummaryrefslogtreecommitdiff
path: root/src/wallet.cpp
diff options
context:
space:
mode:
authorGavin Andresen <gavinandresen@gmail.com>2011-09-28 12:30:06 -0400
committerGavin Andresen <gavinandresen@gmail.com>2011-12-19 12:40:19 -0500
commitbf798734db4539a39edd6badf54a1c3aecf193e5 (patch)
tree850f60c149335de2c85c0aafd10a8fc50aca9c7e /src/wallet.cpp
parent1466b8b78ad8cabf93ac3f65f5929213c5dd3c8f (diff)
downloadbitcoin-bf798734db4539a39edd6badf54a1c3aecf193e5.tar.xz
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/wallet.cpp')
-rw-r--r--src/wallet.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/wallet.cpp b/src/wallet.cpp
index 87f5dfd659..a662111d49 100644
--- a/src/wallet.cpp
+++ b/src/wallet.cpp
@@ -997,12 +997,11 @@ bool CWallet::CreateTransaction(const vector<pair<CScript, int64> >& vecSend, CW
vector<unsigned char> vchPubKey = reservekey.GetReservedKey();
// assert(mapKeys.count(vchPubKey));
- // Fill a vout to ourself, using same address type as the payment
+ // Fill a vout to ourself
+ // TODO: pass in scriptChange instead of reservekey so
+ // change transaction isn't always pay-to-bitcoin-address
CScript scriptChange;
- if (vecSend[0].first.GetBitcoinAddress().IsValid())
- scriptChange.SetBitcoinAddress(vchPubKey);
- else
- scriptChange << vchPubKey << OP_CHECKSIG;
+ scriptChange.SetBitcoinAddress(vchPubKey);
// Insert change txn at random position:
vector<CTxOut>::iterator position = wtxNew.vout.begin()+GetRandInt(wtxNew.vout.size());