X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=lightning%2Fsrc%2Fln%2Fchannel.rs;h=f44109432a581c2f28a7b3797cc187d24546ed31;hb=7c238476845fcc1115f3115a650f82d7b7f170b1;hp=dece3649e5e89d27c361eb3985be459c8234b7ad;hpb=8c69bb11b8e6c53f69e9a27f6657d69bee1b7e5e;p=rust-lightning diff --git a/lightning/src/ln/channel.rs b/lightning/src/ln/channel.rs index dece3649..f4410943 100644 --- a/lightning/src/ln/channel.rs +++ b/lightning/src/ln/channel.rs @@ -18,7 +18,7 @@ use secp256k1; use ln::features::{ChannelFeatures, InitFeatures}; use ln::msgs; use ln::msgs::{DecodeError, OptionalField, DataLossProtect}; -use ln::channelmonitor::{ChannelMonitor, ChannelMonitorUpdate, ChannelMonitorUpdateStep}; +use ln::channelmonitor::{ChannelMonitor, ChannelMonitorUpdate, ChannelMonitorUpdateStep, HTLC_FAIL_BACK_BUFFER}; use ln::channelmanager::{PendingHTLCStatus, HTLCSource, HTLCFailReason, HTLCFailureMsg, PendingHTLCInfo, RAACommitmentOrder, PaymentPreimage, PaymentHash, BREAKDOWN_TIMEOUT, MAX_LOCAL_BREAKDOWN_TIMEOUT}; use ln::chan_utils::{CounterpartyCommitmentSecrets, LocalCommitmentTransaction, TxCreationKeys, HTLCOutputInCommitment, HTLC_SUCCESS_TX_WEIGHT, HTLC_TIMEOUT_TX_WEIGHT, make_funding_redeemscript, ChannelPublicKeys}; use ln::chan_utils; @@ -35,6 +35,7 @@ use std; use std::default::Default; use std::{cmp,mem,fmt}; use std::sync::{Arc}; +use std::ops::Deref; #[cfg(test)] pub struct ChannelValueStat { @@ -247,6 +248,7 @@ pub(super) struct Channel { #[cfg(test)] pub(super) local_keys: ChanSigner, shutdown_pubkey: PublicKey, + destination_script: Script, // Our commitment numbers start at 2^48-1 and count down, whereas the ones used in transaction // generation start at 0 and count up...this simplifies some parts of implementation at the @@ -293,7 +295,7 @@ pub(super) struct Channel { holding_cell_update_fee: Option, next_local_htlc_id: u64, next_remote_htlc_id: u64, - channel_update_count: u32, + update_time_counter: u32, feerate_per_kw: u64, #[cfg(debug_assertions)] @@ -351,7 +353,9 @@ pub(super) struct Channel { their_shutdown_scriptpubkey: Option