## Summary
`Swan.relist()` function allows relisting the asset again only if the old buyer round is updated instead of allowing relisting when the phase of the old buyer changes to the `withdraw` phase.
## Vulnerability Details
If a listed asset hasn't been bought by the buyer; the seller of that asset can relist it again via `Swan.relist()` function; where it checks if the old buyer round has been increased, and if so mit allows relisting:
```javascript
function relist(address _asset, address _buyer, uint256 _price) external {
AssetListing storage asset = listings[_asset];
//...
(uint256 oldRound, , ) = BuyerAgent(asset.buyer).getRoundPhase();
if (oldRound <= asset.round) {
revert RoundNotFinished(_asset, asset.round);
}
//...
}
```
## Impact
By knowing that the buyer agent has three phases for each round: sell, buy and withdraw, where in the withdraw phase the buyer can't purchase any previously listed assets, then locking the asset that hasn't been purchased in the buy phase of the old buyer for the entire round (waiting for the enire withdraw phase to end) is unfair for the seller as he will be losing other opportunities to list his assets for other buyers.
## Proof of Concept
[Swan.relist() / L217-L220](https://github.com/Cyfrin/2024-10-swan-dria/blob/c8686b199daadcef3161980022e12b66a5304f8e/contracts/swan/Swan.sol#L217C9-L220C10)
```javascript
function relist(address _asset, address _buyer, uint256 _price) external {
AssetListing storage asset = listings[_asset];
//...
(uint256 oldRound, , ) = BuyerAgent(asset.buyer).getRoundPhase();
if (oldRound <= asset.round) {
revert RoundNotFinished(_asset, asset.round);
}
//...
}
```
## Tools Used
Manual Review.
## Recommendations
Update `Swan.relist()` to enable relisting the asset if the `oldRound <= asset.round` && old buyer is in `withdraw` phase.