@@ -1101,20 +1101,19 @@ void CWallet::SyncTransaction(const CTransactionRef& ptx, CWalletTx::Confirmatio
11011101 MarkInputsDirty (ptx);
11021102}
11031103
1104- void CWallet::transactionAddedToMempool (const CTransactionRef& ptx ) {
1104+ void CWallet::transactionAddedToMempool (const CTransactionRef& tx ) {
11051105 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 });
11081107
1109- auto it = mapWallet.find (ptx ->GetHash ());
1108+ auto it = mapWallet.find (tx ->GetHash ());
11101109 if (it != mapWallet.end ()) {
11111110 it->second .fInMempool = true ;
11121111 }
11131112}
11141113
1115- void CWallet::transactionRemovedFromMempool (const CTransactionRef &ptx , MemPoolRemovalReason reason) {
1114+ void CWallet::transactionRemovedFromMempool (const CTransactionRef& tx , MemPoolRemovalReason reason) {
11161115 LOCK (cs_wallet);
1117- auto it = mapWallet.find (ptx ->GetHash ());
1116+ auto it = mapWallet.find (tx ->GetHash ());
11181117 if (it != mapWallet.end ()) {
11191118 it->second .fInMempool = false ;
11201119 }
@@ -1146,7 +1145,7 @@ void CWallet::transactionRemovedFromMempool(const CTransactionRef &ptx, MemPoolR
11461145 // distinguishing between conflicted and unconfirmed transactions are
11471146 // imperfect, and could be improved in general, see
11481147 // 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 });
11501149 }
11511150}
11521151
@@ -1158,8 +1157,7 @@ void CWallet::blockConnected(const CBlock& block, int height)
11581157 m_last_block_processed_height = height;
11591158 m_last_block_processed = block_hash;
11601159 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});
11631161 transactionRemovedFromMempool (block.vtx [index], MemPoolRemovalReason::BLOCK);
11641162 }
11651163}
@@ -1175,8 +1173,7 @@ void CWallet::blockDisconnected(const CBlock& block, int height)
11751173 m_last_block_processed_height = height - 1 ;
11761174 m_last_block_processed = block.hashPrevBlock ;
11771175 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 });
11801177 }
11811178}
11821179
@@ -1716,8 +1713,7 @@ CWallet::ScanResult CWallet::ScanForWalletTransactions(const uint256& start_bloc
17161713 break ;
17171714 }
17181715 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 );
17211717 }
17221718 // scan succeeded, record block as most recent successfully scanned
17231719 result.last_scanned_block = block_hash;
0 commit comments