X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=src%2Fln%2Fchannel.rs;h=86855c1b82f40c5b92b9fe89ccee381db056a674;hb=d7b33fcd847f5480e438b2df176449d73f582090;hp=fe92f9d6ff8ce917c48a90fe18ad7619dadb1e81;hpb=374ea1f05e301b7f2c47781ad4f7a3ac5ac909fd;p=rust-lightning diff --git a/src/ln/channel.rs b/src/ln/channel.rs index fe92f9d6..86855c1b 100644 --- a/src/ln/channel.rs +++ b/src/ln/channel.rs @@ -18,7 +18,7 @@ use ln::msgs; use ln::msgs::{HandleError, MsgEncodable}; use ln::channelmonitor::ChannelMonitor; use ln::channelmanager::{PendingForwardHTLCInfo, HTLCFailReason}; -use ln::chan_utils::{TxCreationKeys,HTLCOutputInCommitment}; +use ln::chan_utils::{TxCreationKeys,HTLCOutputInCommitment,HTLC_SUCCESS_TX_WEIGHT,HTLC_TIMEOUT_TX_WEIGHT}; use ln::chan_utils; use chain::chaininterface::{FeeEstimator,ConfirmationTarget}; use util::{transaction_utils,rng}; @@ -43,7 +43,7 @@ impl ChannelKeys { pub fn new_from_seed(seed: &[u8; 32]) -> Result { let mut prk = [0; 32]; hkdf_extract(Sha256::new(), b"rust-lightning key gen salt", seed, &mut prk); - let secp_ctx = Secp256k1::new(); + let secp_ctx = Secp256k1::without_caps(); let mut okm = [0; 32]; hkdf_expand(Sha256::new(), &prk, b"rust-lightning funding key info", &mut okm); @@ -254,6 +254,12 @@ pub struct Channel { channel_update_count: u32, feerate_per_kw: u64, + #[cfg(test)] + // Used in ChannelManager's tests to send a revoked transaction + pub last_local_commitment_txn: Vec, + #[cfg(not(test))] + last_local_commitment_txn: Vec, + last_sent_closing_fee: Option<(u64, u64)>, // (feerate, fee) /// The hash of the block in which the funding transaction reached our CONF_TARGET. We use this @@ -285,6 +291,8 @@ pub struct Channel { their_delayed_payment_basepoint: PublicKey, their_htlc_basepoint: PublicKey, their_cur_commitment_point: PublicKey, + + their_prev_commitment_point: Option, their_node_id: PublicKey, their_shutdown_scriptpubkey: Option