X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=lightning%2Fsrc%2Fchain%2Fonchaintx.rs;h=b4f5438adfb144645aa3acff008580a7fd74a8fc;hb=35573bb3d7bf8c7f7b9d8759afa555aec2735a44;hp=d6777cc5c8cfd494409f5832f29efb3699bc21ab;hpb=6f16453275638e2753dbb0791e852f096a633b9d;p=rust-lightning diff --git a/lightning/src/chain/onchaintx.rs b/lightning/src/chain/onchaintx.rs index d6777cc5..b4f5438a 100644 --- a/lightning/src/chain/onchaintx.rs +++ b/lightning/src/chain/onchaintx.rs @@ -365,6 +365,14 @@ impl OnchainTxHandler { } } + pub(crate) fn get_prev_holder_commitment_to_self_value(&self) -> Option { + self.prev_holder_commitment.as_ref().map(|commitment| commitment.to_broadcaster_value_sat()) + } + + pub(crate) fn get_cur_holder_commitment_to_self_value(&self) -> u64 { + self.holder_commitment.to_broadcaster_value_sat() + } + /// Lightning security model (i.e being able to redeem/timeout HTLC or penalize coutnerparty onchain) lays on the assumption of claim transactions getting confirmed before timelock expiration /// (CSV or CLTV following cases). In case of high-fee spikes, claim tx may stuck in the mempool, so you need to bump its feerate quickly using Replace-By-Fee or Child-Pay-For-Parent. /// Panics if there are signing errors, because signing operations in reaction to on-chain events