Skip to content

Conversation

@rhlsthrm
Copy link
Contributor

@rhlsthrm rhlsthrm commented Oct 8, 2018

PR for reentrancy fix in LCOpenTimeout.

require(now > Channels[_lcID].LCopenTimeout);
require(msg.sender == Channels[_lcID].partyAddresses[0], "Request not sent by channel party A");
require(Channels[_lcID].isOpen == false, "Channel has been joined");
require(now > Channels[_lcID].LCopenTimeout, "Channel timeout has not expire");
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo: expired

uint256 ethbalanceA = Channels[_lcID].ethBalances[0];
uint256 tokenbalanceA = Channels[_lcID].erc20Balances[0];

Channels[_lcID].ethBalances[0] = 0;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion: copy ethBalanceA, tokenBalanceA, token to variables, and delete the channel before transfers. Might consume less gas.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion is invalid till repository includes some sort of gas meter.

@rhlsthrm rhlsthrm force-pushed the reentrancy-protection branch from a11966d to 117b7f2 Compare October 8, 2018 22:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants