Skip to content

Commit 4038f14

Browse files
committed
events: box AnchorDescriptor. reduce size_of Event 1072 -> 720
1 parent 4e770af commit 4038f14

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

lightning/src/chain/channelmonitor.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3544,7 +3544,7 @@ impl<Signer: EcdsaChannelSigner> ChannelMonitorImpl<Signer> {
35443544
package_target_feerate_sat_per_1000_weight,
35453545
commitment_tx,
35463546
commitment_tx_fee_satoshis,
3547-
anchor_descriptor: AnchorDescriptor {
3547+
anchor_descriptor: Box::new(AnchorDescriptor {
35483548
channel_derivation_parameters: ChannelDerivationParameters {
35493549
keys_id: self.channel_keys_id,
35503550
value_satoshis: channel_parameters.channel_value_satoshis,
@@ -3554,7 +3554,7 @@ impl<Signer: EcdsaChannelSigner> ChannelMonitorImpl<Signer> {
35543554
txid: commitment_txid,
35553555
vout: anchor_output_idx,
35563556
},
3557-
},
3557+
}),
35583558
pending_htlcs: pending_nondust_htlcs,
35593559
}));
35603560
},

lightning/src/events/bump_transaction.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ pub enum BumpTransactionEvent {
172172
commitment_tx_fee_satoshis: u64,
173173
/// The descriptor to sign the anchor input of the anchor transaction constructed as a
174174
/// result of consuming this event.
175-
anchor_descriptor: AnchorDescriptor,
175+
anchor_descriptor: Box<AnchorDescriptor>,
176176
/// The set of pending HTLCs on the commitment transaction that need to be resolved once the
177177
/// commitment transaction confirms.
178178
pending_htlcs: Vec<HTLCOutputInCommitment>,
@@ -1076,14 +1076,14 @@ mod tests {
10761076
package_target_feerate_sat_per_1000_weight: 868,
10771077
commitment_tx_fee_satoshis: 930,
10781078
commitment_tx,
1079-
anchor_descriptor: AnchorDescriptor {
1079+
anchor_descriptor: Box::new(AnchorDescriptor {
10801080
channel_derivation_parameters: ChannelDerivationParameters {
10811081
value_satoshis: 42_000_000,
10821082
keys_id: [42; 32],
10831083
transaction_parameters,
10841084
},
10851085
outpoint: OutPoint { txid: Txid::from_byte_array([42; 32]), vout: 0 },
1086-
},
1086+
}),
10871087
pending_htlcs: Vec::new(),
10881088
});
10891089
}

0 commit comments

Comments
 (0)