@@ -1138,6 +1138,7 @@ void CWallet::TransactionAddedToMempool(const CTransactionRef& ptx) {
11381138}
11391139
11401140void CWallet::BlockConnected (const std::shared_ptr<const CBlock>& pblock, const CBlockIndex *pindex, const std::vector<CTransactionRef>& vtxConflicted) {
1141+ LOCK2 (cs_main, cs_wallet);
11411142 // TODO: Tempoarily ensure that mempool removals are notified before
11421143 // connected transactions. This shouldn't matter, but the abandoned
11431144 // state of transactions in our wallet is currently cleared when we
@@ -1147,18 +1148,17 @@ void CWallet::BlockConnected(const std::shared_ptr<const CBlock>& pblock, const
11471148 // the notification that the conflicted transaction was evicted.
11481149
11491150 for (const CTransactionRef& ptx : vtxConflicted) {
1150- LOCK2 (cs_main, cs_wallet);
11511151 SyncTransaction (ptx, NULL , -1 );
11521152 }
11531153 for (size_t i = 0 ; i < pblock->vtx .size (); i++) {
1154- LOCK2 (cs_main, cs_wallet);
11551154 SyncTransaction (pblock->vtx [i], pindex, i);
11561155 }
11571156}
11581157
11591158void CWallet::BlockDisconnected (const std::shared_ptr<const CBlock>& pblock) {
1159+ LOCK2 (cs_main, cs_wallet);
1160+
11601161 for (const CTransactionRef& ptx : pblock->vtx ) {
1161- LOCK2 (cs_main, cs_wallet);
11621162 SyncTransaction (ptx, NULL , -1 );
11631163 }
11641164}
0 commit comments