Add m_last_block_processed_height field in CWallet

At BlockConnected/BlockDisconnected, we rely on height of block
itself to know current height of wallet
This commit is contained in:
Antoine Riard
2019-04-20 12:02:52 -04:00
parent 10b4729e33
commit 5aacc3eff1
4 changed files with 54 additions and 5 deletions

View File

@@ -139,10 +139,12 @@ void TestGUI(interfaces::Node& node)
wallet->LoadWallet(firstRun);
{
auto spk_man = wallet->GetLegacyScriptPubKeyMan();
auto locked_chain = wallet->chain().lock();
LOCK(wallet->cs_wallet);
AssertLockHeld(spk_man->cs_wallet);
wallet->SetAddressBook(GetDestinationForKey(test.coinbaseKey.GetPubKey(), wallet->m_default_address_type), "", "receive");
spk_man->AddKeyPubKey(test.coinbaseKey, test.coinbaseKey.GetPubKey());
wallet->SetLastBlockProcessed(105, ::ChainActive().Tip()->GetBlockHash());
}
{
auto locked_chain = wallet->chain().lock();