projects
/
rust-lightning
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Ensure all HTLCs for a claimed payment are claimed on startup
[rust-lightning]
/
lightning
/
src
/
chain
/
channelmonitor.rs
diff --git
a/lightning/src/chain/channelmonitor.rs
b/lightning/src/chain/channelmonitor.rs
index 738fff3837ca045f5c8c9e3e93e588bb88974191..fd66e585208b6b580e6f981d633fa8c0d94c028e 100644
(file)
--- a/
lightning/src/chain/channelmonitor.rs
+++ b/
lightning/src/chain/channelmonitor.rs
@@
-1085,7
+1085,8
@@
impl<Signer: Sign> ChannelMonitor<Signer> {
self.inner.lock().unwrap().provide_latest_holder_commitment_tx(holder_commitment_tx, htlc_outputs).map_err(|_| ())
}
self.inner.lock().unwrap().provide_latest_holder_commitment_tx(holder_commitment_tx, htlc_outputs).map_err(|_| ())
}
- #[cfg(test)]
+ /// This is used to provide payment preimage(s) out-of-band during startup without updating the
+ /// off-chain state with a new commitment transaction.
pub(crate) fn provide_payment_preimage<B: Deref, F: Deref, L: Deref>(
&self,
payment_hash: &PaymentHash,
pub(crate) fn provide_payment_preimage<B: Deref, F: Deref, L: Deref>(
&self,
payment_hash: &PaymentHash,
@@
-1631,6
+1632,10
@@
impl<Signer: Sign> ChannelMonitor<Signer> {
res
}
res
}
+
+ pub(crate) fn get_stored_preimages(&self) -> HashMap<PaymentHash, PaymentPreimage> {
+ self.inner.lock().unwrap().payment_preimages.clone()
+ }
}
/// Compares a broadcasted commitment transaction's HTLCs with those in the latest state,
}
/// Compares a broadcasted commitment transaction's HTLCs with those in the latest state,