Edgecase for res list (#109)
* Super quick hotfix to token cli * Account for edgecase in res list when you for some reason overwrite yourself * Another fix, keeping track of population.
This commit is contained in:
parent
ecb99be7c8
commit
42a8d1d309
|
@ -269,6 +269,14 @@ impl ReservationList for ReservationListV2 {
|
|||
&& self.reservations[usize_offset].address == replaced.address;
|
||||
if !allowable_edgecase {
|
||||
return Err(MetadataError::TriedToReplaceAnExistingReservation.into());
|
||||
} else {
|
||||
// Since we will have incremented, decrease in advance so we dont blow the spot check.
|
||||
// Super hacky but this code is to be deprecated.
|
||||
self.set_current_reservation_spots(
|
||||
self.current_reservation_spots
|
||||
.checked_sub(replaced.total_spots)
|
||||
.ok_or(MetadataError::NumericalOverflowError)?,
|
||||
);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
|
Loading…
Reference in New Issue