projects
/
rust-lightning
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Correct `outbound_payment` route-fetch calls to pass the hash + ID
[rust-lightning]
/
lightning
/
src
/
chain
/
channelmonitor.rs
diff --git
a/lightning/src/chain/channelmonitor.rs
b/lightning/src/chain/channelmonitor.rs
index 401221acdd17d4a3fbf586e5057d0019d2b07a09..00c96104c834fcaaeafec4152cb0eb7ecb7e8601 100644
(file)
--- a/
lightning/src/chain/channelmonitor.rs
+++ b/
lightning/src/chain/channelmonitor.rs
@@
-282,7
+282,7
@@
impl HolderSignedTx {
/// We use this to track static counterparty commitment transaction data and to generate any
/// justice or 2nd-stage preimage/timeout transactions.
/// We use this to track static counterparty commitment transaction data and to generate any
/// justice or 2nd-stage preimage/timeout transactions.
-#[derive(PartialEq, Eq)]
+#[derive(
Clone,
PartialEq, Eq)]
struct CounterpartyCommitmentParameters {
counterparty_delayed_payment_base_key: PublicKey,
counterparty_htlc_base_key: PublicKey,
struct CounterpartyCommitmentParameters {
counterparty_delayed_payment_base_key: PublicKey,
counterparty_htlc_base_key: PublicKey,
@@
-336,7
+336,7
@@
impl Readable for CounterpartyCommitmentParameters {
/// observed, as well as the transaction causing it.
///
/// Used to determine when the on-chain event can be considered safe from a chain reorganization.
/// observed, as well as the transaction causing it.
///
/// Used to determine when the on-chain event can be considered safe from a chain reorganization.
-#[derive(PartialEq, Eq)]
+#[derive(
Clone,
PartialEq, Eq)]
struct OnchainEventEntry {
txid: Txid,
height: u32,
struct OnchainEventEntry {
txid: Txid,
height: u32,
@@
-379,7
+379,7
@@
type CommitmentTxCounterpartyOutputInfo = Option<(u32, u64)>;
/// Upon discovering of some classes of onchain tx by ChannelMonitor, we may have to take actions on it
/// once they mature to enough confirmations (ANTI_REORG_DELAY)
/// Upon discovering of some classes of onchain tx by ChannelMonitor, we may have to take actions on it
/// once they mature to enough confirmations (ANTI_REORG_DELAY)
-#[derive(PartialEq, Eq)]
+#[derive(
Clone,
PartialEq, Eq)]
enum OnchainEvent {
/// An outbound HTLC failing after a transaction is confirmed. Used
/// * when an outbound HTLC output is spent by us after the HTLC timed out
enum OnchainEvent {
/// An outbound HTLC failing after a transaction is confirmed. Used
/// * when an outbound HTLC output is spent by us after the HTLC timed out
@@
-638,7
+638,7
@@
pub enum Balance {
}
/// An HTLC which has been irrevocably resolved on-chain, and has reached ANTI_REORG_DELAY.
}
/// An HTLC which has been irrevocably resolved on-chain, and has reached ANTI_REORG_DELAY.
-#[derive(PartialEq, Eq)]
+#[derive(
Clone,
PartialEq, Eq)]
struct IrrevocablyResolvedHTLC {
commitment_tx_output_idx: Option<u32>,
/// The txid of the transaction which resolved the HTLC, this may be a commitment (if the HTLC
struct IrrevocablyResolvedHTLC {
commitment_tx_output_idx: Option<u32>,
/// The txid of the transaction which resolved the HTLC, this may be a commitment (if the HTLC
@@
-711,7
+711,13
@@
pub struct ChannelMonitor<Signer: WriteableEcdsaChannelSigner> {
inner: Mutex<ChannelMonitorImpl<Signer>>,
}
inner: Mutex<ChannelMonitorImpl<Signer>>,
}
-#[derive(PartialEq)]
+impl<Signer: WriteableEcdsaChannelSigner> Clone for ChannelMonitor<Signer> {
+ fn clone(&self) -> Self {
+ Self { inner: Mutex::new(self.inner.lock().unwrap().clone()) }
+ }
+}
+
+#[derive(Clone, PartialEq)]
pub(crate) struct ChannelMonitorImpl<Signer: WriteableEcdsaChannelSigner> {
latest_update_id: u64,
commitment_transaction_number_obscure_factor: u64,
pub(crate) struct ChannelMonitorImpl<Signer: WriteableEcdsaChannelSigner> {
latest_update_id: u64,
commitment_transaction_number_obscure_factor: u64,