From: Matt Corallo Date: Fri, 7 Feb 2020 22:48:46 +0000 (-0500) Subject: Track counterparty's commitment secrets in Channel directly. X-Git-Tag: v0.0.12~119^2~11 X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=commitdiff_plain;h=6296eb1c5f607251b09188f2073d4c35bc394d24;p=rust-lightning Track counterparty's commitment secrets in Channel directly. In the process of removing a local ChannelMonitor in each Channel, we need to track our counterpartys' commitment secrets so that we can check them locally instead of calling our channel monitor to do that work for us. --- diff --git a/lightning/src/ln/channel.rs b/lightning/src/ln/channel.rs index d98059332..5a1e6f264 100644 --- a/lightning/src/ln/channel.rs +++ b/lightning/src/ln/channel.rs @@ -20,7 +20,7 @@ use ln::msgs; use ln::msgs::{DecodeError, OptionalField, DataLossProtect}; use ln::channelmonitor::ChannelMonitor; use ln::channelmanager::{PendingHTLCStatus, HTLCSource, HTLCFailReason, HTLCFailureMsg, PendingHTLCInfo, RAACommitmentOrder, PaymentPreimage, PaymentHash, BREAKDOWN_TIMEOUT, MAX_LOCAL_BREAKDOWN_TIMEOUT}; -use ln::chan_utils::{LocalCommitmentTransaction, TxCreationKeys, HTLCOutputInCommitment, HTLC_SUCCESS_TX_WEIGHT, HTLC_TIMEOUT_TX_WEIGHT, make_funding_redeemscript, ChannelPublicKeys}; +use ln::chan_utils::{CounterpartyCommitmentSecrets, LocalCommitmentTransaction, TxCreationKeys, HTLCOutputInCommitment, HTLC_SUCCESS_TX_WEIGHT, HTLC_TIMEOUT_TX_WEIGHT, make_funding_redeemscript, ChannelPublicKeys}; use ln::chan_utils; use chain::chaininterface::{FeeEstimator,ConfirmationTarget}; use chain::transaction::OutPoint; @@ -348,6 +348,7 @@ pub(super) struct Channel { their_shutdown_scriptpubkey: Option