only allow calling set_ready once

This commit is contained in:
Aleixo Sánchez
2021-10-24 10:40:49 +02:00
parent 90a4b332cb
commit dc671597d0

View File

@@ -48,7 +48,7 @@ contract Swap {
// Alice must call set_ready() within t_0 once she verifies the XMR has been locked
function set_ready() external {
require(msg.sender == owner && block.timestamp < timeout_0);
require(!isReady && msg.sender == owner && block.timestamp < timeout_0);
isReady = true;
timeout_1 = block.timestamp + 1 days;
emit IsReady(true);