mirror of
https://github.com/aljazceru/cdk.git
synced 2025-12-18 21:25:09 +01:00
Cdk ldk node (#904)
* feat: add LDK Node Lightning backend with comprehensive integration - Add new cdk-ldk-node crate implementing Lightning backend using LDK Node - Extend MintPayment trait with start/stop methods for processor lifecycle management - Add LDK Node configuration support to cdk-mintd with chain source and gossip options - Enhance mint startup/shutdown to properly manage payment processor lifecycle --------- Co-authored-by: Erik <78821053+swedishfrenchpress@users.noreply.github.com>
This commit is contained in:
@@ -546,6 +546,11 @@ where
|
||||
amount_paid: Amount,
|
||||
payment_id: String,
|
||||
) -> Result<Amount, Self::Err> {
|
||||
if amount_paid == Amount::ZERO {
|
||||
tracing::warn!("Amount payments of zero amount should not be recorded.");
|
||||
return Err(Error::Duplicate);
|
||||
}
|
||||
|
||||
// Check if payment_id already exists in mint_quote_payments
|
||||
let exists = query(
|
||||
r#"
|
||||
@@ -592,6 +597,13 @@ where
|
||||
.checked_add(amount_paid)
|
||||
.ok_or_else(|| database::Error::AmountOverflow)?;
|
||||
|
||||
tracing::debug!(
|
||||
"Mint quote {} amount paid was {} is now {}.",
|
||||
quote_id,
|
||||
current_amount_paid,
|
||||
new_amount_paid
|
||||
);
|
||||
|
||||
// Update the amount_paid
|
||||
query(
|
||||
r#"
|
||||
|
||||
Reference in New Issue
Block a user