Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Delete all acknowledged packet commitments #54

Merged
merged 1 commit into from
Aug 26, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 6 additions & 13 deletions modules/src/core/ics04_channel/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -170,20 +170,13 @@ pub trait ChannelKeeper {
)?;
}
PacketResult::Ack(res) => {
match res.seq_number {
Some(s) => {
//Ordered Channel
self.store_next_sequence_ack((res.port_id.clone(), res.channel_id), s)?;
}
None => {
//Unordered Channel
self.delete_packet_commitment((
res.port_id.clone(),
res.channel_id,
res.seq,
))?;
}
if let Some(s) = res.seq_number {
//Ordered Channel
self.store_next_sequence_ack((res.port_id.clone(), res.channel_id), s)?;
}

// Delete packet commitment since packet has been aknowledged
self.delete_packet_commitment((res.port_id.clone(), res.channel_id, res.seq))?;
}
PacketResult::Timeout(res) => {
if let Some(c) = res.channel {
Expand Down