aboutsummaryrefslogtreecommitdiff
path: root/src/test/wallet_tests.cpp
diff options
context:
space:
mode:
authorJonas Schnelli <[email protected]>2013-06-03 15:18:41 +0200
committerJonas Schnelli <[email protected]>2013-06-03 15:18:41 +0200
commit39fe9de6b2b255969971beca8fa25a33ad2e5750 (patch)
tree6686041f6b801d0ea5185b026a480a5be61510e6 /src/test/wallet_tests.cpp
parentMaxOSX: settings fixes (#2371) (diff)
parentMerge pull request #2672 from Diapolo/Qt_testnet (diff)
downloaddiscoin-39fe9de6b2b255969971beca8fa25a33ad2e5750.tar.xz
discoin-39fe9de6b2b255969971beca8fa25a33ad2e5750.zip
Merge branch 'master' of git://github.com/bitcoin/bitcoin into prefsFix
Signed-off-by: Jonas Schnelli <[email protected]> Conflicts: bitcoin-qt.pro
Diffstat (limited to 'src/test/wallet_tests.cpp')
-rw-r--r--src/test/wallet_tests.cpp17
1 files changed, 8 insertions, 9 deletions
diff --git a/src/test/wallet_tests.cpp b/src/test/wallet_tests.cpp
index a4cbfaee4..a14f6b2b7 100644
--- a/src/test/wallet_tests.cpp
+++ b/src/test/wallet_tests.cpp
@@ -21,13 +21,12 @@ static vector<COutput> vCoins;
static void add_coin(int64 nValue, int nAge = 6*24, bool fIsFromMe = false, int nInput=0)
{
- static int i;
- CTransaction* tx = new CTransaction;
- tx->nLockTime = i++; // so all transactions get different hashes
- tx->vout.resize(nInput+1);
- tx->vout[nInput].nValue = nValue;
- CWalletTx* wtx = new CWalletTx(&wallet, *tx);
- delete tx;
+ static int nextLockTime = 0;
+ CTransaction tx;
+ tx.nLockTime = nextLockTime++; // so all transactions get different hashes
+ tx.vout.resize(nInput+1);
+ tx.vout[nInput].nValue = nValue;
+ CWalletTx* wtx = new CWalletTx(&wallet, tx);
if (fIsFromMe)
{
// IsFromMe() returns (GetDebit() > 0), and GetDebit() is 0 if vin.empty(),
@@ -55,8 +54,8 @@ static bool equal_sets(CoinSet a, CoinSet b)
BOOST_AUTO_TEST_CASE(coin_selection_tests)
{
- static CoinSet setCoinsRet, setCoinsRet2;
- static int64 nValueRet;
+ CoinSet setCoinsRet, setCoinsRet2;
+ int64 nValueRet;
// test multiple times to allow for differences in the shuffle order
for (int i = 0; i < RUN_TESTS; i++)