Merge ChainMonitor impl blocks
[rust-lightning] / lightning / src / ln / onchaintx.rs
index 281bc919060a95445b1f8d76a7d1764ee15b500a..dbe86c869ce4ddfa720a4f8c94d43e405305661c 100644 (file)
@@ -657,7 +657,7 @@ impl<ChanSigner: ChannelKeys> OnchainTxHandler<ChanSigner> {
                None
        }
 
-       pub(super) fn block_connected<B: Deref, F: Deref, L: Deref>(&mut self, txn_matched: &[&Transaction], claimable_outpoints: Vec<ClaimRequest>, height: u32, broadcaster: B, fee_estimator: F, logger: L)
+       pub(crate) fn block_connected<B: Deref, F: Deref, L: Deref>(&mut self, txn_matched: &[&Transaction], claimable_outpoints: Vec<ClaimRequest>, height: u32, broadcaster: B, fee_estimator: F, logger: L)
                where B::Target: BroadcasterInterface,
                      F::Target: FeeEstimator,
                                        L::Target: Logger,
@@ -877,18 +877,9 @@ impl<ChanSigner: ChannelKeys> OnchainTxHandler<ChanSigner> {
                }
        }
 
-       pub(super) fn provide_latest_holder_tx(&mut self, tx: HolderCommitmentTransaction) -> Result<(), ()> {
-               // To prevent any unsafe state discrepancy between offchain and onchain, once holder
-               // commitment transaction has been signed due to an event (either block height for
-               // HTLC-timeout or channel force-closure), don't allow any further update of holder
-               // commitment transaction view to avoid delivery of revocation secret to counterparty
-               // for the aformentionned signed transaction.
-               if self.holder_htlc_sigs.is_some() || self.prev_holder_htlc_sigs.is_some() {
-                       return Err(());
-               }
+       pub(super) fn provide_latest_holder_tx(&mut self, tx: HolderCommitmentTransaction) {
                self.prev_holder_commitment = self.holder_commitment.take();
                self.holder_commitment = Some(tx);
-               Ok(())
        }
 
        fn sign_latest_holder_htlcs(&mut self) {