@@ -1200,7 +1200,7 @@ void CWallet::TransactionRemovedFromMempool(const CTransactionRef &ptx) {
12001200 }
12011201}
12021202
1203- void CWallet::BlockConnected (const std::shared_ptr< const CBlock>& pblock , const CBlockIndex *pindex , const std::vector<CTransactionRef>& vtxConflicted) {
1203+ void CWallet::BlockConnected (const CBlock& block , const uint256& block_hash , const std::vector<CTransactionRef>& vtxConflicted) {
12041204 auto ipc_locked = m_ipc_chain->lockState ();
12051205 LOCK (cs_wallet);
12061206 // TODO: Temporarily ensure that mempool removals are notified before
@@ -1215,19 +1215,19 @@ void CWallet::BlockConnected(const std::shared_ptr<const CBlock>& pblock, const
12151215 SyncTransaction (*ipc_locked, ptx, {} /* block hash */ , 0 /* position in block */ );
12161216 TransactionRemovedFromMempool (ptx);
12171217 }
1218- for (size_t i = 0 ; i < pblock-> vtx .size (); i++) {
1219- SyncTransaction (*ipc_locked, pblock-> vtx [i], pindex-> GetBlockHash () , i);
1220- TransactionRemovedFromMempool (pblock-> vtx [i]);
1218+ for (size_t i = 0 ; i < block. vtx .size (); i++) {
1219+ SyncTransaction (*ipc_locked, block. vtx [i], block_hash , i);
1220+ TransactionRemovedFromMempool (block. vtx [i]);
12211221 }
12221222
1223- m_last_block_processed = pindex-> GetBlockHash () ;
1223+ m_last_block_processed = block_hash ;
12241224}
12251225
1226- void CWallet::BlockDisconnected (const std::shared_ptr< const CBlock>& pblock ) {
1226+ void CWallet::BlockDisconnected (const CBlock& block ) {
12271227 auto ipc_locked = m_ipc_chain->lockState ();
12281228 LOCK (cs_wallet);
12291229
1230- for (const CTransactionRef& ptx : pblock-> vtx ) {
1230+ for (const CTransactionRef& ptx : block. vtx ) {
12311231 SyncTransaction (*ipc_locked, ptx, {} /* block hash */ , 0 /* position in block */ );
12321232 }
12331233}
@@ -1247,11 +1247,7 @@ void CWallet::BlockUntilSyncedToCurrentChain() {
12471247 }
12481248 }
12491249
1250- std::promise<void > promise;
1251- CallFunctionInValidationInterfaceQueue ([&promise] {
1252- promise.set_value ();
1253- });
1254- promise.get_future ().wait ();
1250+ m_ipc_chain->waitForNotifications ();
12551251}
12561252
12571253
@@ -1940,7 +1936,7 @@ std::vector<uint256> CWallet::ResendWalletTransactionsBefore(ipc::Chain::LockedS
19401936 return result;
19411937}
19421938
1943- void CWallet::ResendWalletTransactions (int64_t nBestBlockTime, CConnman* connman )
1939+ void CWallet::ResendWalletTransactions (int64_t nBestBlockTime)
19441940{
19451941 // Do this infrequently and randomly to avoid giving away
19461942 // that these are our transactions.
@@ -3937,7 +3933,7 @@ CWallet* CWallet::CreateWalletFromFile(ipc::Chain& ipc_chain, const std::string
39373933 walletInstance->m_last_block_processed .SetNull ();
39383934 }
39393935
3940- RegisterValidationInterface ( walletInstance);
3936+ walletInstance-> m_ipc_handler = ipc_chain. handleNotifications (* walletInstance);
39413937
39423938 const int tip_height = ipc_locked->getHeight ();
39433939 if (tip_height >= 0 && tip_height != index_rescan)
0 commit comments