Skip to content

Commit

Permalink
Handle signer checkpoint interval check case where index is 0
Browse files Browse the repository at this point in the history
  • Loading branch information
keppel committed Feb 13, 2024
1 parent 1c3a43b commit 367f39d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/bitcoin/signer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,11 @@ where
let last_signed_btc_height: Option<u64> = self
.client()
.query(|app: InnerApp| {
Ok(app.bitcoin.checkpoints.get(index - 1)?.signed_at_btc_height)
Ok(app
.bitcoin
.checkpoints
.get(index.saturating_sub(1))?
.signed_at_btc_height)
})
.await?
.map(|v| v as u64);
Expand Down

0 comments on commit 367f39d

Please sign in to comment.