[vault] Standing approvals: a rule's use count saturates instead of overflowing (a stored count at its end made the next standing signature panic in debug builds); v0.16.1
This commit is contained in:
@@ -865,7 +865,7 @@ impl Vault {
|
||||
if let (Approval::Standing, Some(id)) = (approval, rule)
|
||||
&& let Some(r) = self.signing.standing.iter_mut().find(|r| r.id == id)
|
||||
{
|
||||
r.uses += 1;
|
||||
r.uses = r.uses.saturating_add(1);
|
||||
r.last_used = Some(now);
|
||||
}
|
||||
Ok(Signed { bytes, sha256 })
|
||||
|
||||
Reference in New Issue
Block a user