From 323dce75109c5262141100ac7aaf6c70cf1113ab Mon Sep 17 00:00:00 2001 From: Artem Date: Mon, 2 Oct 2023 11:36:44 +0200 Subject: [PATCH] Fix: saving origination accounts --- internal/postgres/store/save.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/internal/postgres/store/save.go b/internal/postgres/store/save.go index 14184414b..22a5a3aa7 100644 --- a/internal/postgres/store/save.go +++ b/internal/postgres/store/save.go @@ -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 {