@@ -1101,20 +1101,19 @@ void CWallet::SyncTransaction(const CTransactionRef& ptx, CWalletTx::Confirmatio
1101
1101
MarkInputsDirty (ptx);
1102
1102
}
1103
1103
1104
- void CWallet::transactionAddedToMempool (const CTransactionRef& ptx ) {
1104
+ void CWallet::transactionAddedToMempool (const CTransactionRef& tx ) {
1105
1105
LOCK (cs_wallet);
1106
- CWalletTx::Confirmation confirm (CWalletTx::Status::UNCONFIRMED, /* block_height */ 0 , {}, /* nIndex */ 0 );
1107
- SyncTransaction (ptx, confirm);
1106
+ SyncTransaction (tx, {CWalletTx::Status::UNCONFIRMED, /* block height */ 0 , /* block hash */ {}, /* index */ 0 });
1108
1107
1109
- auto it = mapWallet.find (ptx ->GetHash ());
1108
+ auto it = mapWallet.find (tx ->GetHash ());
1110
1109
if (it != mapWallet.end ()) {
1111
1110
it->second .fInMempool = true ;
1112
1111
}
1113
1112
}
1114
1113
1115
- void CWallet::transactionRemovedFromMempool (const CTransactionRef &ptx , MemPoolRemovalReason reason) {
1114
+ void CWallet::transactionRemovedFromMempool (const CTransactionRef& tx , MemPoolRemovalReason reason) {
1116
1115
LOCK (cs_wallet);
1117
- auto it = mapWallet.find (ptx ->GetHash ());
1116
+ auto it = mapWallet.find (tx ->GetHash ());
1118
1117
if (it != mapWallet.end ()) {
1119
1118
it->second .fInMempool = false ;
1120
1119
}
@@ -1146,7 +1145,7 @@ void CWallet::transactionRemovedFromMempool(const CTransactionRef &ptx, MemPoolR
1146
1145
// distinguishing between conflicted and unconfirmed transactions are
1147
1146
// imperfect, and could be improved in general, see
1148
1147
// https://github.com/bitcoin-core/bitcoin-devwiki/wiki/Wallet-Transaction-Conflict-Tracking
1149
- SyncTransaction (ptx , {CWalletTx::Status::UNCONFIRMED, /* block height */ 0 , /* block hash */ {}, /* index */ 0 });
1148
+ SyncTransaction (tx , {CWalletTx::Status::UNCONFIRMED, /* block height */ 0 , /* block hash */ {}, /* index */ 0 });
1150
1149
}
1151
1150
}
1152
1151
@@ -1158,8 +1157,7 @@ void CWallet::blockConnected(const CBlock& block, int height)
1158
1157
m_last_block_processed_height = height;
1159
1158
m_last_block_processed = block_hash;
1160
1159
for (size_t index = 0 ; index < block.vtx .size (); index++) {
1161
- CWalletTx::Confirmation confirm (CWalletTx::Status::CONFIRMED, height, block_hash, index);
1162
- SyncTransaction (block.vtx [index], confirm);
1160
+ SyncTransaction (block.vtx [index], {CWalletTx::Status::CONFIRMED, height, block_hash, (int )index});
1163
1161
transactionRemovedFromMempool (block.vtx [index], MemPoolRemovalReason::BLOCK);
1164
1162
}
1165
1163
}
@@ -1175,8 +1173,7 @@ void CWallet::blockDisconnected(const CBlock& block, int height)
1175
1173
m_last_block_processed_height = height - 1 ;
1176
1174
m_last_block_processed = block.hashPrevBlock ;
1177
1175
for (const CTransactionRef& ptx : block.vtx ) {
1178
- CWalletTx::Confirmation confirm (CWalletTx::Status::UNCONFIRMED, /* block_height */ 0 , {}, /* nIndex */ 0 );
1179
- SyncTransaction (ptx, confirm);
1176
+ SyncTransaction (ptx, {CWalletTx::Status::UNCONFIRMED, /* block height */ 0 , /* block hash */ {}, /* index */ 0 });
1180
1177
}
1181
1178
}
1182
1179
@@ -1716,8 +1713,7 @@ CWallet::ScanResult CWallet::ScanForWalletTransactions(const uint256& start_bloc
1716
1713
break ;
1717
1714
}
1718
1715
for (size_t posInBlock = 0 ; posInBlock < block.vtx .size (); ++posInBlock) {
1719
- CWalletTx::Confirmation confirm (CWalletTx::Status::CONFIRMED, block_height, block_hash, posInBlock);
1720
- SyncTransaction (block.vtx [posInBlock], confirm, fUpdate );
1716
+ SyncTransaction (block.vtx [posInBlock], {CWalletTx::Status::CONFIRMED, block_height, block_hash, (int )posInBlock}, fUpdate );
1721
1717
}
1722
1718
// scan succeeded, record block as most recent successfully scanned
1723
1719
result.last_scanned_block = block_hash;
0 commit comments