Skip to content

Commit bfe32ae

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 f267108 commit bfe32ae

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
@@ -955,7 +955,6 @@ impl<Signer: Sign> Writeable for ChannelMonitorImpl<Signer> {
955955

956956
self.lockdown_from_offchain.write(writer)?;
957957
self.holder_tx_signed.write(writer)?;
958-
self.allow_automated_broadcast.write(writer)?;
959958

960959
write_tlv_fields!(writer, {
961960
(1, self.funding_spend_confirmed, option),
@@ -3372,7 +3371,6 @@ impl<'a, Signer: Sign, K: KeysInterface<Signer = Signer>> ReadableArgs<&'a K>
33723371

33733372
let lockdown_from_offchain = Readable::read(reader)?;
33743373
let holder_tx_signed = Readable::read(reader)?;
3375-
let allow_automated_broadcast: bool = Readable::read(reader)?;
33763374

33773375
if let Some(prev_commitment_tx) = prev_holder_signed_commitment_tx.as_mut() {
33783376
let prev_holder_value = onchain_tx_handler.get_prev_holder_commitment_to_self_value();
@@ -3458,7 +3456,7 @@ impl<'a, Signer: Sign, K: KeysInterface<Signer = Signer>> ReadableArgs<&'a K>
34583456

34593457
secp_ctx,
34603458

3461-
allow_automated_broadcast,
3459+
allow_automated_broadcast: allow_automated_broadcast.unwrap(),
34623460
})))
34633461
}
34643462
}

lightning/src/ln/functional_tests.rs

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

48084808
assert!(nodes[0].chain_monitor.watch_channel(deserialized_chanmon.get_funding_txo().0, deserialized_chanmon).is_ok());
48094809
check_added_monitors!(nodes[0], 1);
4810-
nodes[0].node.get_and_clear_pending_msg_events();
4811-
nodes[0].node.get_and_clear_pending_events();
4810+
check_closed_event!(nodes[0], 1, ClosureReason::HolderForceClosed);
48124811
}
48134812

48144813
macro_rules! check_spendable_outputs {

0 commit comments

Comments
 (0)