Skip to content

Commit

Permalink
Merge branch 'main' into quake/setup-since
Browse files Browse the repository at this point in the history
  • Loading branch information
quake authored Oct 24, 2024
2 parents 6a043c5 + a7e530a commit 152eaad
Show file tree
Hide file tree
Showing 53 changed files with 2,411 additions and 785 deletions.
27 changes: 25 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ bitflags = { version = "2.5.0", features = ["serde"] }
ckb-hash = "0.115.0"
secp256k1 = { version = "0.28.0", features = ["serde", "recovery", "rand-std"] }
musig2 = { version = "0.0.11", features = ["secp256k1", "serde"] }
ractor = "0.9.7"
ractor = "=0.9.7"
arcode = "0.2.4"
nom = "7.1.3"
regex = "1.10.5"
Expand All @@ -47,6 +47,7 @@ socket2 = "0.5.7"
lnd-grpc-tonic-client = "0.3.0"
git-version = "0.3.9"
fiber-sphinx = "1.0.1"
strum = { version = "0.26", features = ["derive"] }
tokio = { version = "1", features = [
"io-util",
"macros",
Expand Down
2 changes: 2 additions & 0 deletions src/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ pub enum Error {
CkbInvoiceError(#[from] InvoiceError),
#[error("Funding error: {0}")]
FundingError(#[from] FundingError),
#[error("Send payment error: {0}")]
SendPaymentError(String),
#[error("InvalidParameter: {0}")]
InvalidParameter(String),
#[error("Network Graph error: {0}")]
Expand Down
490 changes: 368 additions & 122 deletions src/fiber/channel.rs

Large diffs are not rendered by default.

11 changes: 11 additions & 0 deletions src/fiber/fee.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,3 +120,14 @@ pub(crate) fn calculate_shutdown_tx_fee(
let tx_size = shutdown_tx_size(udt_type_script, shutdown_scripts) as u64;
fee_rate.fee(tx_size).as_u64()
}

pub(crate) fn calculate_tlc_forward_fee(amount: u128, fee_proportational_millionths: u128) -> u128 {
let fee = fee_proportational_millionths * amount;
let base_fee = fee / 1_000_000;
let remainder = fee % 1_000_000;
if remainder > 0 {
base_fee + 1
} else {
base_fee
}
}
Loading

0 comments on commit 152eaad

Please sign in to comment.