@@ -1138,6 +1138,7 @@ void CWallet::TransactionAddedToMempool(const CTransactionRef& ptx) {
1138
1138
}
1139
1139
1140
1140
void CWallet::BlockConnected (const std::shared_ptr<const CBlock>& pblock, const CBlockIndex *pindex, const std::vector<CTransactionRef>& vtxConflicted) {
1141
+ LOCK2 (cs_main, cs_wallet);
1141
1142
// TODO: Tempoarily ensure that mempool removals are notified before
1142
1143
// connected transactions. This shouldn't matter, but the abandoned
1143
1144
// 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
1147
1148
// the notification that the conflicted transaction was evicted.
1148
1149
1149
1150
for (const CTransactionRef& ptx : vtxConflicted) {
1150
- LOCK2 (cs_main, cs_wallet);
1151
1151
SyncTransaction (ptx, NULL , -1 );
1152
1152
}
1153
1153
for (size_t i = 0 ; i < pblock->vtx .size (); i++) {
1154
- LOCK2 (cs_main, cs_wallet);
1155
1154
SyncTransaction (pblock->vtx [i], pindex, i);
1156
1155
}
1157
1156
}
1158
1157
1159
1158
void CWallet::BlockDisconnected (const std::shared_ptr<const CBlock>& pblock) {
1159
+ LOCK2 (cs_main, cs_wallet);
1160
+
1160
1161
for (const CTransactionRef& ptx : pblock->vtx ) {
1161
- LOCK2 (cs_main, cs_wallet);
1162
1162
SyncTransaction (ptx, NULL , -1 );
1163
1163
}
1164
1164
}
0 commit comments