node/routing: remove error scenario from Database::prune
A call to `Database::prune` with no limit could result in a domain-defined overflow error. If the limit is not provided, then it uses `i64::MAX`. It is reasonable to expect that if the `usize` provided is more than `i64::MAX` then the `i64::MAX` value is acceptable to use for pruning.
This commit is contained in:
parent
95b3d10961
commit
958422a7c4
|
|
@ -222,10 +222,8 @@ impl Store for Database {
|
|||
ignore: &NodeId,
|
||||
) -> Result<usize, Error> {
|
||||
let limit: i64 = limit
|
||||
.unwrap_or(i64::MAX as usize)
|
||||
.try_into()
|
||||
.map_err(|_| Error::UnitOverflow)?;
|
||||
|
||||
.and_then(|limit| i64::try_from(limit).ok())
|
||||
.unwrap_or(i64::MAX);
|
||||
let mut stmt = self.db.prepare(
|
||||
"DELETE FROM routing
|
||||
WHERE node <> ?1 AND rowid IN
|
||||
|
|
|
|||
Loading…
Reference in New Issue