Commit cfaaa4b pythcoiner
committed
1 parent 264f09a commit cfaaa4b Copy full SHA for cfaaa4b
File tree 2 files changed +7
-6
lines changed
2 files changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -584,15 +584,17 @@ impl DaemonControl {
584
584
let mut db_conn = self . db . connection ( ) ;
585
585
let spend_psbts = db_conn. list_spend ( ) ;
586
586
587
- let txids_set: HashSet < _ > = txids
588
- . as_ref ( )
589
- . map ( |list| list. iter ( ) . cloned ( ) . collect ( ) )
590
- . unwrap_or_default ( ) ;
587
+ let txids_set: Option < HashSet < _ > > =
588
+ txids. as_ref ( ) . map ( |list| list. iter ( ) . cloned ( ) . collect ( ) ) ;
591
589
592
590
let spend_txs = spend_psbts
593
591
. into_iter ( )
594
592
. filter ( |( psbt, _) | {
595
- txids_set. is_empty ( ) || txids_set. contains ( & psbt. unsigned_tx . txid ( ) )
593
+ if let Some ( set) = & txids_set {
594
+ set. contains ( & psbt. unsigned_tx . txid ( ) )
595
+ } else {
596
+ false
597
+ }
596
598
} )
597
599
. map ( |( psbt, updated_at) | ListSpendEntry { psbt, updated_at } )
598
600
. collect ( ) ;
Original file line number Diff line number Diff line change @@ -485,7 +485,6 @@ def test_list_spend(lianad, bitcoind):
485
485
# change and which one doesn't.
486
486
list_res = lianad .rpc .listspendtxs ()["spend_txs" ]
487
487
assert len (list_res ) == 2
488
-
489
488
first_psbt = next (entry for entry in list_res if entry ["psbt" ] == res ["psbt" ])
490
489
assert time_before_update <= first_psbt ["updated_at" ] <= int (time .time ())
491
490
second_psbt = next (entry for entry in list_res if entry ["psbt" ] == res_b ["psbt" ])
You can’t perform that action at this time.
0 commit comments