Changeset View
Changeset View
Standalone View
Standalone View
src/qt/test/wallettests.cpp
Show First 20 Lines • Show All 126 Lines • ▼ Show 20 Lines | wallet->LoadWallet(firstRun); | ||||
GetDestinationForKey(test.coinbaseKey.GetPubKey(), | GetDestinationForKey(test.coinbaseKey.GetPubKey(), | ||||
wallet->m_default_address_type), | wallet->m_default_address_type), | ||||
"", "receive"); | "", "receive"); | ||||
spk_man->AddKeyPubKey(test.coinbaseKey, test.coinbaseKey.GetPubKey()); | spk_man->AddKeyPubKey(test.coinbaseKey, test.coinbaseKey.GetPubKey()); | ||||
wallet->SetLastBlockProcessed(105, | wallet->SetLastBlockProcessed(105, | ||||
::ChainActive().Tip()->GetBlockHash()); | ::ChainActive().Tip()->GetBlockHash()); | ||||
} | } | ||||
{ | { | ||||
auto locked_chain = wallet->chain().lock(); | |||||
LockAssertion lock(::cs_main); | |||||
WalletRescanReserver reserver(*wallet); | WalletRescanReserver reserver(*wallet); | ||||
reserver.reserve(); | reserver.reserve(); | ||||
CWallet::ScanResult result = wallet->ScanForWalletTransactions( | CWallet::ScanResult result = wallet->ScanForWalletTransactions( | ||||
locked_chain->getBlockHash(0), BlockHash(), reserver, | Params().GetConsensus().hashGenesisBlock, BlockHash(), reserver, | ||||
true /* fUpdate */); | true /* fUpdate */); | ||||
QCOMPARE(result.status, CWallet::ScanResult::SUCCESS); | QCOMPARE(result.status, CWallet::ScanResult::SUCCESS); | ||||
QCOMPARE(result.last_scanned_block, | QCOMPARE(result.last_scanned_block, | ||||
::ChainActive().Tip()->GetBlockHash()); | ::ChainActive().Tip()->GetBlockHash()); | ||||
QVERIFY(result.last_failed_block.IsNull()); | QVERIFY(result.last_failed_block.IsNull()); | ||||
} | } | ||||
wallet->SetBroadcastTransactions(true); | wallet->SetBroadcastTransactions(true); | ||||
▲ Show 20 Lines • Show All 117 Lines • Show Last 20 Lines |