This repository has been archived by the owner on Apr 20, 2022. It is now read-only.
Ensure end-to-end that challenging network exits works properly #23
Labels
bug
Something isn't working
Looking at the server and client library code, I don't think this is working currently. The issue is that the timestamp the server sends back to the clients is
time.Now().Unix()
. The contract usesnow >= timestamp
to check if the timestamp has expired or not.In other words, the contract thinks the timestamp is when the match expires, and the server thinks the timestamp is when the match began.
The server needs to add
DGame.MatchDuration()
totime.Now().Unix()
to align with what the contract expects. This is better than adding it to the check on the contract side because doing it properly like that would require checking that the player is playing the correct game as well.To add to that, the server should be monitoring exits as well, and cancel any ones for which it possesses a valid signed timestamp of.
The text was updated successfully, but these errors were encountered: