Skip to content

Commit 1f02eb9

Browse files
committed
prepare v4.3.1
1 parent 0c7a6b0 commit 1f02eb9

7 files changed

Lines changed: 29 additions & 16 deletions

File tree

‎CHANGELOG.md‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
# Changelog
22

3+
## [4.3.1] - 2026-08-10
4+
5+
### Fixed
6+
- use the `help` rpc instead of the (custom) version string to determine available rpc methods
7+
- validate amount in htlc hook handler
8+
- don't shutdown plugin if a background task fails, increase log level instead and restart task
9+
- fixed `sling-deletejob` with `delete_stats=true` not deleting stat files
10+
- fixed typo in `sling-go` output json: `tasks_failed_start:` -> `tasks_failed_start`
11+
- a few theoretical integer overflows
12+
313
## [4.3.0] - 2026-06-07
414

515
### Added

‎Cargo.lock‎

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎Cargo.toml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "sling"
3-
version = "4.3.0"
3+
version = "4.3.1"
44
edition = "2024"
55
rust-version = "1.85.0"
66

‎coffee.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
plugin:
22
name: sling
3-
version: 4.3.0
3+
version: 4.3.1
44
lang: rust
55
install: |
66
cargo build --release && cp target/release/sling . && cargo clean

‎src/parse.rs‎

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,11 @@ pub async fn parse_job(
5151

5252
//also convert to msat
5353
let amount_msat = match ar.get("amount") {
54-
Some(amt) => {
55-
amt.as_u64()
56-
.ok_or(anyhow!("amount must be a positive integer"))?
57-
* 1_000
58-
}
54+
Some(amt) => amt
55+
.as_u64()
56+
.ok_or(anyhow!("amount must be a positive integer"))?
57+
.checked_mul(1_000)
58+
.ok_or_else(|| anyhow!("amount too large"))?,
5959
None => return Err(anyhow!("Missing amount")),
6060
};
6161
if amount_msat == 0 {
@@ -115,7 +115,8 @@ pub async fn parse_job(
115115
job.add_depleteuptoamount_msat(
116116
da.as_u64()
117117
.ok_or(anyhow!("depleteuptoamount must be an integer"))?
118-
* 1_000,
118+
.checked_mul(1_000)
119+
.ok_or_else(|| anyhow!("depleteuptoamount too large"))?,
119120
);
120121
}
121122

‎src/rpc_sling.rs‎

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ pub async fn slinggo(
204204
}
205205
}
206206

207-
Ok(json!({ "tasks_started": spawn_count , "tasks_failed_start:": spawn_fail_count }))
207+
Ok(json!({ "tasks_started": spawn_count , "tasks_failed_start": spawn_fail_count }))
208208
}
209209

210210
pub async fn slingstop(
@@ -620,11 +620,6 @@ pub async fn slingdeletejob(
620620
match input {
621621
inp if inp.eq("all") => {
622622
stop_job(plugin.clone(), serde_json::Value::Array(vec![])).await?;
623-
let jobfile = sling_dir.join(JOB_FILE_NAME);
624-
fs::remove_file(jobfile).await?;
625-
plugin.state().tasks.lock().remove_all_tasks();
626-
log::info!("Deleted all jobs");
627-
let except_chans = read_except_chans(&sling_dir).await?;
628623
if delete_stats {
629624
let jobs = read_jobs(&sling_dir, plugin.clone()).await?;
630625
for scid in jobs.keys() {
@@ -636,6 +631,13 @@ pub async fn slingdeletejob(
636631
.await;
637632
}
638633
}
634+
635+
let jobfile = sling_dir.join(JOB_FILE_NAME);
636+
fs::remove_file(jobfile).await?;
637+
plugin.state().tasks.lock().remove_all_tasks();
638+
log::info!("Deleted all jobs");
639+
let except_chans = read_except_chans(&sling_dir).await?;
640+
639641
let mut config = plugin.state().config.lock();
640642
config.exclude_chans_pull.clone_from(&except_chans);
641643
config.exclude_chans_push = except_chans;

‎src/slings.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -673,7 +673,7 @@ fn build_candidatelist(
673673
continue;
674674
}
675675

676-
if scid.block() > blockheight - config.candidates_min_age {
676+
if scid.block() > blockheight.saturating_sub(config.candidates_min_age) {
677677
log::trace!(
678678
"{}: build_candidatelist: {} is too new: {}>{}",
679679
task_ident,

0 commit comments

Comments
 (0)