Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/test/wallet_tests.cpp
Show First 20 Lines • Show All 649 Lines • ▼ Show 20 Lines | if (blockTime > 0) { | ||||
block->nTime = blockTime; | block->nTime = blockTime; | ||||
block->phashBlock = &hash; | block->phashBlock = &hash; | ||||
} | } | ||||
CWalletTx wtx(&wallet, MakeTransactionRef(tx)); | CWalletTx wtx(&wallet, MakeTransactionRef(tx)); | ||||
if (block) { | if (block) { | ||||
wtx.SetMerkleBranch(block, 0); | wtx.SetMerkleBranch(block, 0); | ||||
} | } | ||||
{ | |||||
LOCK(cs_main); | |||||
wallet.AddToWallet(wtx); | wallet.AddToWallet(wtx); | ||||
} | |||||
LOCK(wallet.cs_wallet); | LOCK(wallet.cs_wallet); | ||||
return wallet.mapWallet.at(wtx.GetId()).nTimeSmart; | return wallet.mapWallet.at(wtx.GetId()).nTimeSmart; | ||||
} | } | ||||
// Simple test to verify assignment of CWalletTx::nSmartTime value. Could be | // Simple test to verify assignment of CWalletTx::nSmartTime value. Could be | ||||
// expanded to cover more corner cases of smart time logic. | // expanded to cover more corner cases of smart time logic. | ||||
BOOST_AUTO_TEST_CASE(ComputeTimeSmart) { | BOOST_AUTO_TEST_CASE(ComputeTimeSmart) { | ||||
CWallet wallet(Params()); | CWallet wallet(Params()); | ||||
▲ Show 20 Lines • Show All 138 Lines • Show Last 20 Lines |