diff --git a/contracts/escrow/src/lib.rs b/contracts/escrow/src/lib.rs index 61c639a..5a25941 100644 --- a/contracts/escrow/src/lib.rs +++ b/contracts/escrow/src/lib.rs @@ -451,6 +451,11 @@ impl EscrowContract { MATCH_TTL_LEDGERS, ); + // Release game_id so it can be reused in a rematch + env.storage() + .persistent() + .remove(&DataKey::GameId(m.game_id.clone())); + // Remove from active match index Self::remove_from_active(&env, match_id); @@ -587,6 +592,11 @@ impl EscrowContract { MATCH_TTL_LEDGERS, ); + // Release game_id so it can be reused in a rematch + env.storage() + .persistent() + .remove(&DataKey::GameId(m.game_id.clone())); + // Remove from active match index Self::remove_from_active(&env, match_id);