@@ -308,7 +308,7 @@ fn save_transaction_details_and_utxos<D: BatchDatabase>(
308
308
timestamp : u64 ,
309
309
height : Option < u32 > ,
310
310
updates : & mut dyn BatchOperations ,
311
- utxo_deps : & HashMap < OutPoint , UTXO > ,
311
+ utxo_deps : & HashMap < OutPoint , OutPoint > ,
312
312
) -> Result < ( ) , Error > {
313
313
let tx = db
314
314
. get_raw_tx ( txid) ?
@@ -343,8 +343,8 @@ fn save_transaction_details_and_utxos<D: BatchDatabase>(
343
343
}
344
344
345
345
// removes conflicting UTXO if any (generated from same inputs, like for example RBF)
346
- if let Some ( utxo ) = utxo_deps. get ( & input. previous_output ) {
347
- updates. del_utxo ( & utxo . outpoint ) ?;
346
+ if let Some ( outpoint ) = utxo_deps. get ( & input. previous_output ) {
347
+ updates. del_utxo ( & outpoint) ?;
348
348
}
349
349
}
350
350
@@ -386,15 +386,15 @@ fn save_transaction_details_and_utxos<D: BatchDatabase>(
386
386
fn utxos_deps < D : BatchDatabase > (
387
387
db : & mut D ,
388
388
tx_raw_in_db : & HashMap < Txid , Transaction > ,
389
- ) -> Result < HashMap < OutPoint , UTXO > , Error > {
389
+ ) -> Result < HashMap < OutPoint , OutPoint > , Error > {
390
390
let utxos = db. iter_utxos ( ) ?;
391
391
let mut utxos_deps = HashMap :: new ( ) ;
392
392
for utxo in utxos {
393
393
let from_tx = tx_raw_in_db
394
394
. get ( & utxo. outpoint . txid )
395
395
. ok_or_else ( || Error :: TransactionNotFound ) ?;
396
396
for input in from_tx. input . iter ( ) {
397
- utxos_deps. insert ( input. previous_output , utxo. clone ( ) ) ;
397
+ utxos_deps. insert ( input. previous_output , utxo. outpoint ) ;
398
398
}
399
399
}
400
400
Ok ( utxos_deps)
0 commit comments