Skip to content

Commit

Permalink
Add another condition to the account created check
Browse files Browse the repository at this point in the history
  • Loading branch information
alexsporn committed Apr 26, 2024
1 parent 09a268b commit 7b217c3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/protocol/engine/accounts/accountsledger/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -402,8 +402,9 @@ func (m *Manager) rollbackAccountTo(accountData *accounts.AccountData, targetSlo
accountData.ExpirySlot = diffChange.PreviousExpirySlot
}

if diffChange.PreviousOutputID == iotago.EmptyOutputID {
if diffChange.PreviousOutputID == iotago.EmptyOutputID && diffChange.NewOutputID != iotago.EmptyOutputID {
// Account was created in this slot, so we need to remove it
m.LogDebug("Account was created in this slot, so we need to remove it", "accountID", accountData.ID, "slot", diffSlot, "diffChange.PreviousOutputID", diffChange.PreviousOutputID, "diffChange.NewOutputID", diffChange.NewOutputID)
return true, false, nil
}

Expand Down

0 comments on commit 7b217c3

Please sign in to comment.