Skip to content

Commit

Permalink
added channelExpired get function
Browse files Browse the repository at this point in the history
  • Loading branch information
gretzke committed Dec 10, 2019
1 parent c99bb1f commit 7185af4
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions smart_contract/contracts/SocketPaymentChannel.sol
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,15 @@ contract SocketPaymentChannel {
return ecrecover(prefixedMessage, v, r, s) == channelCustomer;
}

/// @notice determine whether the current payment channel has expired
/// @return true if channel has expired
function channelExpired() public view returns(bool) {
if (channelActive) {
return now > expirationDate;
}
return false;
}

/// @notice function to withdraw funds from the smart contract
/// @return true on success, false on failure
function withdraw() public returns (bool) {
Expand Down

0 comments on commit 7185af4

Please sign in to comment.