File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed
lightning-transaction-sync/src Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -336,17 +336,29 @@ where
336336 script_history. iter ( ) . filter ( |h| h. tx_hash == * * txid) ;
337337 if let Some ( history) = filtered_history. next ( ) {
338338 let prob_conf_height = history. height as u32 ;
339+ if prob_conf_height <= 0 {
340+ // Skip if it's a an unconfirmed entry.
341+ continue ;
342+ }
339343 let confirmed_tx = self . get_confirmed_tx ( tx, prob_conf_height) ?;
340344 confirmed_txs. push ( confirmed_tx) ;
341345 }
342- debug_assert ! ( filtered_history. next( ) . is_none( ) ) ;
346+ if filtered_history. next ( ) . is_some ( ) {
347+ log_error ! (
348+ self . logger,
349+ "Failed due to server returning multiple history entries for Tx {}." ,
350+ txid
351+ ) ;
352+ return Err ( InternalError :: Failed ) ;
353+ }
343354 }
344355
345356 for ( watched_output, script_history) in
346357 sync_state. watched_outputs . values ( ) . zip ( output_results)
347358 {
348359 for possible_output_spend in script_history {
349360 if possible_output_spend. height <= 0 {
361+ // Skip if it's a an unconfirmed entry.
350362 continue ;
351363 }
352364
You can’t perform that action at this time.
0 commit comments