Changeset View
Changeset View
Standalone View
Standalone View
src/qt/test/wallettests.cpp
Show First 20 Lines • Show All 124 Lines • ▼ Show 20 Lines | wallet->LoadWallet(firstRun); | ||||
wallet->m_default_address_type), | wallet->m_default_address_type), | ||||
"", "receive"); | "", "receive"); | ||||
wallet->AddKeyPubKey(test.coinbaseKey, test.coinbaseKey.GetPubKey()); | wallet->AddKeyPubKey(test.coinbaseKey, test.coinbaseKey.GetPubKey()); | ||||
} | } | ||||
{ | { | ||||
auto locked_chain = wallet->chain().lock(); | auto locked_chain = wallet->chain().lock(); | ||||
WalletRescanReserver reserver(wallet.get()); | WalletRescanReserver reserver(wallet.get()); | ||||
reserver.reserve(); | reserver.reserve(); | ||||
const CBlockIndex *const null_block = nullptr; | CWallet::ScanResult result = wallet->ScanForWalletTransactions( | ||||
const CBlockIndex *stop_block, *failed_block; | locked_chain->getBlockHash(0), BlockHash(), reserver, | ||||
QCOMPARE(wallet->ScanForWalletTransactions( | true /* fUpdate */); | ||||
::ChainActive().Genesis(), nullptr, reserver, failed_block, | QCOMPARE(result.status, CWallet::ScanResult::SUCCESS); | ||||
stop_block, true /* fUpdate */), | QCOMPARE(result.stop_block, ::ChainActive().Tip()->GetBlockHash()); | ||||
CWallet::ScanResult::SUCCESS); | QVERIFY(result.failed_block.IsNull()); | ||||
QCOMPARE(stop_block, ::ChainActive().Tip()); | |||||
QCOMPARE(failed_block, null_block); | |||||
} | } | ||||
wallet->SetBroadcastTransactions(true); | wallet->SetBroadcastTransactions(true); | ||||
// Create widgets for sending coins and listing transactions. | // Create widgets for sending coins and listing transactions. | ||||
std::unique_ptr<const PlatformStyle> platformStyle( | std::unique_ptr<const PlatformStyle> platformStyle( | ||||
PlatformStyle::instantiate("other")); | PlatformStyle::instantiate("other")); | ||||
auto node = interfaces::MakeNode(); | auto node = interfaces::MakeNode(); | ||||
OptionsModel optionsModel(*node); | OptionsModel optionsModel(*node); | ||||
▲ Show 20 Lines • Show All 112 Lines • Show Last 20 Lines |