From 30025626a43cd436506b5a8836596376ac41a3a7 Mon Sep 17 00:00:00 2001 From: Piotr Macek <4007944+piotrm50@users.noreply.github.com> Date: Fri, 7 Jun 2024 11:52:24 +0200 Subject: [PATCH] Do not check if account output was spent. There is a race condition between updating UTXO and Accounts ledgers upon commitment. --- pkg/protocol/engine/ledger/ledger/ledger.go | 8 -------- 1 file changed, 8 deletions(-) diff --git a/pkg/protocol/engine/ledger/ledger/ledger.go b/pkg/protocol/engine/ledger/ledger/ledger.go index 4e3a57725..37a61e4b1 100644 --- a/pkg/protocol/engine/ledger/ledger/ledger.go +++ b/pkg/protocol/engine/ledger/ledger/ledger.go @@ -722,14 +722,6 @@ func (l *Ledger) resolveAccountOutput(accountID iotago.AccountID, slot iotago.Sl l.utxoLedger.ReadLockLedger() defer l.utxoLedger.ReadUnlockLedger() - isUnspent, err := l.utxoLedger.IsOutputIDUnspentWithoutLocking(accountMetadata.OutputID()) - if err != nil { - return nil, ierrors.Wrapf(err, "error while checking whether account with output id %s is unspent", accountMetadata.OutputID().ToHex()) - } - if !isUnspent { - return nil, ierrors.WithMessagef(mempool.ErrStateNotFound, "unspent account with output id %s not found", accountMetadata.OutputID().ToHex()) - } - accountOutput, err := l.utxoLedger.ReadOutputByOutputIDWithoutLocking(accountMetadata.OutputID()) if err != nil { return nil, ierrors.Wrapf(err, "error while retrieving account with output id %s", accountMetadata.OutputID().ToHex())