Skip to content

Commit 7342d8c

Browse files
committed
Partially address review
- Use `check_closed_event` instead of clearing pending events - Write new property and read it from TLVs
1 parent dff01e1 commit 7342d8c

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

lightning/src/chain/channelmonitor.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1013,7 +1013,6 @@ impl<Signer: Sign> Writeable for ChannelMonitorImpl<Signer> {
10131013

10141014
self.lockdown_from_offchain.write(writer)?;
10151015
self.holder_tx_signed.write(writer)?;
1016-
self.allow_automated_broadcast.write(writer)?;
10171016

10181017
write_tlv_fields!(writer, {
10191018
(1, self.funding_spend_confirmed, option),
@@ -3644,7 +3643,6 @@ impl<'a, Signer: Sign, K: KeysInterface<Signer = Signer>> ReadableArgs<&'a K>
36443643

36453644
let lockdown_from_offchain = Readable::read(reader)?;
36463645
let holder_tx_signed = Readable::read(reader)?;
3647-
let allow_automated_broadcast: bool = Readable::read(reader)?;
36483646

36493647
if let Some(prev_commitment_tx) = prev_holder_signed_commitment_tx.as_mut() {
36503648
let prev_holder_value = onchain_tx_handler.get_prev_holder_commitment_to_self_value();
@@ -3733,7 +3731,7 @@ impl<'a, Signer: Sign, K: KeysInterface<Signer = Signer>> ReadableArgs<&'a K>
37333731

37343732
secp_ctx,
37353733

3736-
allow_automated_broadcast,
3734+
allow_automated_broadcast: allow_automated_broadcast.unwrap(),
37373735
})))
37383736
}
37393737
}

lightning/src/ln/functional_tests.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4817,8 +4817,7 @@ fn test_deserialize_monitor_force_closed_without_broadcasting_txn() {
48174817

48184818
assert!(nodes[0].chain_monitor.watch_channel(deserialized_chanmon.get_funding_txo().0, deserialized_chanmon).is_ok());
48194819
check_added_monitors!(nodes[0], 1);
4820-
nodes[0].node.get_and_clear_pending_msg_events();
4821-
nodes[0].node.get_and_clear_pending_events();
4820+
check_closed_event!(nodes[0], 1, ClosureReason::HolderForceClosed);
48224821
}
48234822

48244823
macro_rules! check_spendable_outputs {

0 commit comments

Comments
 (0)