]> git.bitcoin.ninja Git - rust-lightning/commitdiff
Add dummy creator for PendingForwardHTLCInfo
authorMatt Corallo <git@bluematt.me>
Mon, 19 Mar 2018 23:55:05 +0000 (19:55 -0400)
committerMatt Corallo <git@bluematt.me>
Fri, 23 Mar 2018 17:16:24 +0000 (13:16 -0400)
src/ln/channelmanager.rs

index 3d70b1d379a4391461b3c5a756e126716d8d701d..0dddfdac6760c473b5e0efabc864eb7dc062b550 100644 (file)
@@ -42,6 +42,20 @@ pub struct PendingForwardHTLCInfo {
        amt_to_forward: u64,
        outgoing_cltv_value: u32,
 }
+//TODO: This is public, and needed to call Channel::update_add_htlc, so there needs to be a way to
+//initialize it usefully...probably make it optional in Channel instead).
+impl PendingForwardHTLCInfo {
+       pub fn dummy() -> Self {
+               Self {
+                       onion_packet: None,
+                       payment_hash: [0; 32],
+                       short_channel_id: 0,
+                       prev_short_channel_id: 0,
+                       amt_to_forward: 0,
+                       outgoing_cltv_value: 0,
+               }
+       }
+}
 
 enum PendingOutboundHTLC {
        IntermediaryHopData {