aboutsummaryrefslogtreecommitdiff
path: root/src/test/wallet_tests.cpp
diff options
context:
space:
mode:
authorRoy Badami <roy@gnomon.org.uk>2014-07-07 22:06:21 +0100
committerRoy Badami <roy@gnomon.org.uk>2014-07-07 22:06:21 +0100
commit96df327834af3b55918adfac9b3f65adfc960b3a (patch)
tree8bd199df46ea6f39f7094c0e7db2185b4d3f5d6d /src/test/wallet_tests.cpp
parent2e4fee2ac4824570c1340a8f8fe2aed4580de879 (diff)
parent1fedd65fcf9ac04b70f0fa8cf6caa9629857d586 (diff)
downloadbitcoin-96df327834af3b55918adfac9b3f65adfc960b3a.tar.xz
Merge remote-tracking branch 'upstream/master'
Conflicts: src/qt/overviewpage.cpp src/qt/transactiondesc.cpp
Diffstat (limited to 'src/test/wallet_tests.cpp')
-rw-r--r--src/test/wallet_tests.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/test/wallet_tests.cpp b/src/test/wallet_tests.cpp
index 1993358826..3887efbd0d 100644
--- a/src/test/wallet_tests.cpp
+++ b/src/test/wallet_tests.cpp
@@ -31,20 +31,22 @@ static vector<COutput> vCoins;
static void add_coin(int64_t nValue, int nAge = 6*24, bool fIsFromMe = false, int nInput=0)
{
static int nextLockTime = 0;
- CTransaction tx;
+ CMutableTransaction tx;
tx.nLockTime = nextLockTime++; // so all transactions get different hashes
tx.vout.resize(nInput+1);
tx.vout[nInput].nValue = nValue;
+ if (fIsFromMe) {
+ // IsFromMe() returns (GetDebit() > 0), and GetDebit() is 0 if vin.empty(),
+ // so stop vin being empty, and cache a non-zero Debit to fake out IsFromMe()
+ tx.vin.resize(1);
+ }
CWalletTx* wtx = new CWalletTx(&wallet, tx);
if (fIsFromMe)
{
- // IsFromMe() returns (GetDebit() > 0), and GetDebit() is 0 if vin.empty(),
- // so stop vin being empty, and cache a non-zero Debit to fake out IsFromMe()
- wtx->vin.resize(1);
wtx->fDebitCached = true;
wtx->nDebitCached = 1;
}
- COutput output(wtx, nInput, nAge);
+ COutput output(wtx, nInput, nAge, true);
vCoins.push_back(output);
}