mirror of
https://github.com/lightningdevkit/rust-lightning.git
synced 2025-02-24 23:08:36 +01:00
Only generate an Event::DiscardFunding
when we need to
5e874c3dc9
changed
`Event::DiscardFunding` to not include a dummy transaction when we
were funded without a full funding tx, but in doing so started
generating `DiscardFunding` events on every channel closure rather
than only when there's actually still a pending funding broadcast.
This restores the previous behavior to only generate the event when
we should actually discard the funding tx.
This commit is contained in:
parent
5e62df7f20
commit
1e285cb417
1 changed files with 9 additions and 6 deletions
|
@ -3547,12 +3547,15 @@ where
|
|||
channel_funding_txo: shutdown_res.channel_funding_txo,
|
||||
}, None));
|
||||
|
||||
if let Some(transaction) = shutdown_res.unbroadcasted_funding_tx {
|
||||
let funding_info = if is_manual_broadcast {
|
||||
shutdown_res.channel_funding_txo.map(|outpoint| FundingInfo::OutPoint{ outpoint })
|
||||
FundingInfo::OutPoint {
|
||||
outpoint: shutdown_res.channel_funding_txo
|
||||
.expect("We had an unbroadcasted funding tx, so should also have had a funding outpoint"),
|
||||
}
|
||||
} else {
|
||||
shutdown_res.unbroadcasted_funding_tx.map(|transaction| FundingInfo::Tx{ transaction })
|
||||
FundingInfo::Tx{ transaction }
|
||||
};
|
||||
if let Some(funding_info) = funding_info {
|
||||
pending_events.push_back((events::Event::DiscardFunding {
|
||||
channel_id: shutdown_res.channel_id, funding_info
|
||||
}, None));
|
||||
|
|
Loading…
Add table
Reference in a new issue