Skip to content

Commit 8ae6661

Browse files
committed
f update to new funding logic
1 parent 8a6a3ce commit 8ae6661

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

lightning/src/chain/channelmonitor.rs

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3021,7 +3021,7 @@ impl<Signer: EcdsaChannelSigner> ChannelMonitor<Signer> {
30213021
let candidate_source: &Option<Box<HTLCSource>> = &candidate_source;
30223022

30233023
let source: &HTLCSource = if let Some(source) = candidate_source {
3024-
&*source
3024+
source
30253025
} else {
30263026
continue;
30273027
};
@@ -3069,25 +3069,25 @@ impl<Signer: EcdsaChannelSigner> ChannelMonitor<Signer> {
30693069
};
30703070
}
30713071

3072-
if Some(confirmed_txid) == us.funding.current_counterparty_commitment_txid
3073-
|| Some(confirmed_txid) == us.funding.prev_counterparty_commitment_txid
3072+
let funding = get_confirmed_funding_scope!(us);
3073+
3074+
if Some(confirmed_txid) == funding.current_counterparty_commitment_txid
3075+
|| Some(confirmed_txid) == funding.prev_counterparty_commitment_txid
30743076
{
30753077
let htlcs = funding.counterparty_claimable_outpoints.get(&confirmed_txid).unwrap();
30763078
walk_htlcs!(
30773079
false,
3078-
htlcs.iter().filter_map(
3079-
|(a, b)| {
3080-
if let &Some(ref source) = b {
3081-
Some((a, Some(&**source)))
3082-
} else {
3083-
None
3084-
}
3080+
htlcs.iter().filter_map(|(a, b)| {
3081+
if let &Some(ref source) = b {
3082+
Some((a, Some(&**source)))
3083+
} else {
3084+
None
30853085
}
3086-
)
3086+
})
30873087
);
3088-
} else if confirmed_txid == us.funding.current_holder_commitment_tx.trust().txid() {
3088+
} else if confirmed_txid == funding.current_holder_commitment_tx.trust().txid() {
30893089
walk_htlcs!(true, holder_commitment_htlcs!(us, CURRENT_WITH_SOURCES));
3090-
} else if let Some(prev_commitment_tx) = &us.funding.prev_holder_commitment_tx {
3090+
} else if let Some(prev_commitment_tx) = &funding.prev_holder_commitment_tx {
30913091
if confirmed_txid == prev_commitment_tx.trust().txid() {
30923092
walk_htlcs!(true, holder_commitment_htlcs!(us, PREV_WITH_SOURCES).unwrap());
30933093
} else {

0 commit comments

Comments
 (0)