Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

node: Fix bug in flow cancel mechanism where the wrong values were being used for tokenEntry #3990

Merged
merged 6 commits into from
Jun 24, 2024
Merged
Show file tree
Hide file tree
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
7 changes: 6 additions & 1 deletion node/pkg/governor/governor.go
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,10 @@ func (gov *ChainGovernor) ProcessMsg(msg *common.MessagePublication) bool {
}

// ProcessMsgForTime handles an incoming message (transfer) and registers it in the chain entries for the Governor.
// Returns true if:
// - the message is not governed
// - the transfer is complete and has already been observed
// - the transfer does not trigger any error conditions (happy path)
// Validation:
// - ensure MessagePublication is not nil
// - check that the MessagePublication is governed
Expand Down Expand Up @@ -567,7 +571,8 @@ func (gov *ChainGovernor) ProcessMsgForTime(msg *common.MessagePublication, now
emitterChainEntry.transfers = append(emitterChainEntry.transfers, transfer)

// Add inverse transfer to destination chain entry if this asset can cancel flows.
key := tokenKey{chain: msg.EmitterChain, addr: msg.EmitterAddress}
key := tokenKey{chain: token.token.chain, addr: token.token.addr}

SEJeff marked this conversation as resolved.
Show resolved Hide resolved
tokenEntry := gov.tokens[key]
if tokenEntry != nil {
// Mandatory check to ensure that the token should be able to reduce the Governor limit.
Expand Down
Loading
Loading