Skip to content
Merged
30 changes: 15 additions & 15 deletions src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,10 @@ use crate::io::{
self, CHANNEL_FORWARDING_STATS_PERSISTENCE_SECONDARY_NAMESPACE,
CHANNEL_TX_FACTS_PERSISTENCE_PRIMARY_NAMESPACE,
CHANNEL_TX_FACTS_PERSISTENCE_SECONDARY_NAMESPACE,
FORWARDED_PAYMENT_PERSISTENCE_PRIMARY_NAMESPACE, PAYMENT_INFO_PERSISTENCE_PRIMARY_NAMESPACE,
PAYMENT_INFO_PERSISTENCE_SECONDARY_NAMESPACE,
PENDING_PAYMENT_INFO_PERSISTENCE_PRIMARY_NAMESPACE,
PENDING_PAYMENT_INFO_PERSISTENCE_SECONDARY_NAMESPACE,
FORWARDED_PAYMENT_PERSISTENCE_PRIMARY_NAMESPACE,
ONCHAIN_PAYMENT_TRACKER_PERSISTENCE_PRIMARY_NAMESPACE,
ONCHAIN_PAYMENT_TRACKER_PERSISTENCE_SECONDARY_NAMESPACE,
PAYMENT_INFO_PERSISTENCE_PRIMARY_NAMESPACE, PAYMENT_INFO_PERSISTENCE_SECONDARY_NAMESPACE,
};
use crate::liquidity::client::lsps2::router::LSPS2Router;
use crate::liquidity::{LSPS2ServiceConfig, LiquiditySourceBuilder, LspConfig};
Expand All @@ -111,8 +111,8 @@ use crate::runtime::{Runtime, RuntimeSpawner};
use crate::tx_broadcaster::TransactionBroadcaster;
use crate::types::{
AsyncPersister, ChainMonitor, ChannelManager, ChannelTxFactsStore, DynStore, DynStoreRef,
DynStoreWrapper, GossipSync, Graph, KeysManager, MessageRouter, OnionMessenger, PaymentStore,
PeerManager, PendingPaymentStore,
DynStoreWrapper, GossipSync, Graph, KeysManager, MessageRouter, OnchainPaymentTracker,
OnionMessenger, PaymentStore, PeerManager,
};
use crate::wallet::persist::{read_address_pool, KVStoreWalletPersister};
use crate::wallet::provenance::NodeChannelLiveness;
Expand Down Expand Up @@ -1605,7 +1605,7 @@ fn build_with_store_internal(
payment_store_res,
channel_forwarding_stats_res,
node_metris_res,
pending_payment_store_res,
payment_tracker_res,
channel_tx_facts_store_res,
address_pool_res,
) = runtime.block_on(async move {
Expand All @@ -1626,8 +1626,8 @@ fn build_with_store_internal(
read_node_metrics(&*kv_store_ref, Arc::clone(&logger_ref)),
read_all_objects(
&*kv_store_ref,
PENDING_PAYMENT_INFO_PERSISTENCE_PRIMARY_NAMESPACE,
PENDING_PAYMENT_INFO_PERSISTENCE_SECONDARY_NAMESPACE,
ONCHAIN_PAYMENT_TRACKER_PERSISTENCE_PRIMARY_NAMESPACE,
ONCHAIN_PAYMENT_TRACKER_PERSISTENCE_SECONDARY_NAMESPACE,
Arc::clone(&logger_ref),
),
read_n_objects(
Expand Down Expand Up @@ -1963,15 +1963,15 @@ fn build_with_store_internal(
},
};

let pending_payment_store = match pending_payment_store_res {
let payment_tracker = match payment_tracker_res {
// NOTE: This store must keep all its entries in memory: the wallet scans it in full on
// every chain tip change and to resolve replaced transactions. It stays bounded anyway,
// as entries are removed once a payment is no longer pending.
Ok(pending_payments) => Arc::new(PendingPaymentStore::new(
pending_payments,
Ok(tracked_payments) => Arc::new(OnchainPaymentTracker::new(
tracked_payments,
KeepAllEntries,
PENDING_PAYMENT_INFO_PERSISTENCE_PRIMARY_NAMESPACE.to_string(),
PENDING_PAYMENT_INFO_PERSISTENCE_SECONDARY_NAMESPACE.to_string(),
ONCHAIN_PAYMENT_TRACKER_PERSISTENCE_PRIMARY_NAMESPACE.to_string(),
ONCHAIN_PAYMENT_TRACKER_PERSISTENCE_SECONDARY_NAMESPACE.to_string(),
Arc::clone(&kv_store),
Arc::clone(&logger),
)),
Expand Down Expand Up @@ -2019,7 +2019,7 @@ fn build_with_store_internal(
Arc::clone(&runtime),
Arc::clone(&config),
Arc::clone(&logger),
Arc::clone(&pending_payment_store),
Arc::clone(&payment_tracker),
Arc::clone(&channel_tx_facts_store),
));

Expand Down
6 changes: 3 additions & 3 deletions src/io/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ pub(crate) const PEER_INFO_PERSISTENCE_KEY: &str = "peers";
pub(crate) const PAYMENT_INFO_PERSISTENCE_PRIMARY_NAMESPACE: &str = "payments";
pub(crate) const PAYMENT_INFO_PERSISTENCE_SECONDARY_NAMESPACE: &str = "";

/// The pending payment information will be persisted under this prefix.
pub(crate) const PENDING_PAYMENT_INFO_PERSISTENCE_PRIMARY_NAMESPACE: &str = "pending_payments";
pub(crate) const PENDING_PAYMENT_INFO_PERSISTENCE_SECONDARY_NAMESPACE: &str = "";
/// Tracked on-chain payments are persisted under this prefix.
pub(crate) const ONCHAIN_PAYMENT_TRACKER_PERSISTENCE_PRIMARY_NAMESPACE: &str = "pending_payments";
pub(crate) const ONCHAIN_PAYMENT_TRACKER_PERSISTENCE_SECONDARY_NAMESPACE: &str = "";

/// The channel transaction provenance facts will be persisted under this prefix.
pub(crate) const CHANNEL_TX_FACTS_PERSISTENCE_PRIMARY_NAMESPACE: &str = "channel_tx_facts";
Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3343,7 +3343,7 @@ mod tests {
value: Amount::from_sat(change_sat),
script_pubkey: test_p2wpkh_script(2),
});
crate::payment::pending_payment_store::test_funding_contribution_with_parts(
crate::wallet::test_utils::test_funding_contribution_with_parts(
1_001,
1_000,
max_feerate_sat_per_kwu,
Expand Down
2 changes: 0 additions & 2 deletions src/payment/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ pub(crate) mod forwarding_store;
mod hrn;
mod metadata;
mod onchain;
pub(crate) mod pending_payment_store;
mod spontaneous;
pub(crate) mod store;
#[cfg(feature = "unified-payments")]
Expand All @@ -34,7 +33,6 @@ pub use forwarding::{
pub(crate) use hrn::HRNResolver;
pub(crate) use metadata::PaymentMetadata;
pub use onchain::OnchainPayment;
pub(crate) use pending_payment_store::{FundingTxCandidate, PendingPaymentDetails};
pub use spontaneous::SpontaneousPayment;
pub use store::{
Channel, ConfirmationStatus, LSPS2Parameters, PageToken, PaymentDetails, PaymentDetailsPage,
Expand Down
Loading
Loading