Skip to content

Commit

Permalink
Fix: saving origination accounts
Browse files Browse the repository at this point in the history
  • Loading branch information
aopoltorzhicky committed Oct 2, 2023
1 parent c8c95a5 commit 323dce7
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions internal/postgres/store/save.go
Original file line number Diff line number Diff line change
Expand Up @@ -264,10 +264,12 @@ func (store *Store) setOperationAccountsId(operation *operation.Operation) error
return errors.Errorf("unknown source account: %s", operation.Source.Address)
}

if id, ok := store.getAccountId(operation.Destination); ok {
operation.DestinationID = id
} else {
return errors.Errorf("unknown destination account: %s", operation.Destination.Address)
if !(operation.IsOrigination() && !operation.IsApplied()) {
if id, ok := store.getAccountId(operation.Destination); ok {
operation.DestinationID = id
} else {
return errors.Errorf("unknown destination account: %s", operation.Destination.Address)
}
}

if id, ok := store.getAccountId(operation.Initiator); ok {
Expand Down

0 comments on commit 323dce7

Please sign in to comment.