File tree Expand file tree Collapse file tree 3 files changed +19
-11
lines changed Expand file tree Collapse file tree 3 files changed +19
-11
lines changed Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ use crate::payment_store::{
8
8
} ;
9
9
10
10
use crate :: io:: { KVStore , EVENT_QUEUE_PERSISTENCE_KEY , EVENT_QUEUE_PERSISTENCE_NAMESPACE } ;
11
- use crate :: logger:: { log_error, log_info, Logger } ;
11
+ use crate :: logger:: { log_debug , log_error, log_info, Logger } ;
12
12
13
13
use lightning:: chain:: chaininterface:: { BroadcasterInterface , ConfirmationTarget , FeeEstimator } ;
14
14
use lightning:: events:: Event as LdkEvent ;
@@ -564,7 +564,10 @@ where
564
564
& Secp256k1 :: new ( ) ,
565
565
) ;
566
566
match res {
567
- Ok ( spending_tx) => self . wallet . broadcast_transaction ( & spending_tx) ,
567
+ Ok ( Some ( spending_tx) ) => self . wallet . broadcast_transaction ( & spending_tx) ,
568
+ Ok ( None ) => {
569
+ log_debug ! ( self . logger, "Omitted spending static outputs: {:?}" , outputs) ;
570
+ }
568
571
Err ( err) => {
569
572
log_error ! ( self . logger, "Error spending outputs: {:?}" , err) ;
570
573
}
Original file line number Diff line number Diff line change 1
1
pub ( crate ) use lightning:: util:: logger:: Logger ;
2
- pub ( crate ) use lightning:: { log_error, log_info, log_trace} ;
2
+ pub ( crate ) use lightning:: { log_debug , log_error, log_info, log_trace} ;
3
3
4
4
use lightning:: util:: logger:: { Level , Record } ;
5
5
use lightning:: util:: ser:: Writer ;
Original file line number Diff line number Diff line change @@ -362,19 +362,24 @@ where
362
362
& self , descriptors : & [ & SpendableOutputDescriptor ] , outputs : Vec < TxOut > ,
363
363
change_destination_script : Script , feerate_sat_per_1000_weight : u32 ,
364
364
secp_ctx : & Secp256k1 < C > ,
365
- ) -> Result < Transaction , ( ) > {
365
+ ) -> Result < Option < Transaction > , ( ) > {
366
366
let only_non_static = & descriptors
367
367
. iter ( )
368
368
. filter ( |desc| !matches ! ( desc, SpendableOutputDescriptor :: StaticOutput { .. } ) )
369
369
. copied ( )
370
370
. collect :: < Vec < _ > > ( ) ;
371
- self . inner . spend_spendable_outputs (
372
- only_non_static,
373
- outputs,
374
- change_destination_script,
375
- feerate_sat_per_1000_weight,
376
- secp_ctx,
377
- )
371
+ if only_non_static. is_empty ( ) {
372
+ return Ok ( None ) ;
373
+ }
374
+ self . inner
375
+ . spend_spendable_outputs (
376
+ only_non_static,
377
+ outputs,
378
+ change_destination_script,
379
+ feerate_sat_per_1000_weight,
380
+ secp_ctx,
381
+ )
382
+ . map ( Some )
378
383
}
379
384
380
385
pub fn sign_message ( & self , msg : & [ u8 ] ) -> Result < String , Error > {
You can’t perform that action at this time.
0 commit comments