Skip to content

Commit

Permalink
Fix optimistic sequence bug
Browse files Browse the repository at this point in the history
  • Loading branch information
cwgoes committed Nov 2, 2020
1 parent eb31a56 commit 8a92af0
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions spec/ics-004-channel-and-packet-semantics/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -354,9 +354,12 @@ function chanOpenTry(
counterpartyChannelIdentifier, connectionHops, version}
provableStore.set(channelPath(portIdentifier, channelIdentifier), channel)
channelCapability = newCapability(channelCapabilityPath(portIdentifier, channelIdentifier))
provableStore.set(nextSequenceSendPath(portIdentifier, channelIdentifier), 1)
provableStore.set(nextSequenceRecvPath(portIdentifier, channelIdentifier), 1)
provableStore.set(nextSequenceAckPath(portIdentifier, channelIdentifier), 1)
// only reset sequences if the previous channel didn't exist, else we might overwrite optimistically-sent packets
if (previous === null) {
provableStore.set(nextSequenceSendPath(portIdentifier, channelIdentifier), 1)
provableStore.set(nextSequenceRecvPath(portIdentifier, channelIdentifier), 1)
provableStore.set(nextSequenceAckPath(portIdentifier, channelIdentifier), 1)
}
return channelCapability
}
```
Expand Down

0 comments on commit 8a92af0

Please sign in to comment.