Skip to content

Commit f397808

Browse files
committed
f Detect inconsistency if previously-confirmed Tx is now unconfirmed
1 parent 0b363dc commit f397808

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

lightning-transaction-sync/src/esplora.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,8 +285,14 @@ where
285285
if let Some(spending_txid) = output_status.txid {
286286
if let Some(spending_tx_status) = output_status.status {
287287
if confirmed_txs.iter().any(|ctx| ctx.tx.txid() == spending_txid) {
288-
continue;
288+
if !spending_tx_status.confirmed {
289+
log_trace!(self.logger, "Inconsistency: Detected previously-confirmed Tx {} as unconfirmed", spending_txid);
290+
return Err(InternalError::Inconsistency);
291+
} else {
292+
continue;
293+
}
289294
}
295+
290296
if let Some(confirmed_tx) = maybe_await!(self
291297
.get_confirmed_tx(
292298
&spending_txid,

0 commit comments

Comments
 (0)