Skip to content
This repository was archived by the owner on Jan 24, 2025. It is now read-only.

Commit 3002562

Browse files
committed
Do not check if account output was spent. There is a race condition between updating UTXO and Accounts ledgers upon commitment.
1 parent 97bab37 commit 3002562

File tree

1 file changed

+0
-8
lines changed

1 file changed

+0
-8
lines changed

pkg/protocol/engine/ledger/ledger/ledger.go

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -722,14 +722,6 @@ func (l *Ledger) resolveAccountOutput(accountID iotago.AccountID, slot iotago.Sl
722722
l.utxoLedger.ReadLockLedger()
723723
defer l.utxoLedger.ReadUnlockLedger()
724724

725-
isUnspent, err := l.utxoLedger.IsOutputIDUnspentWithoutLocking(accountMetadata.OutputID())
726-
if err != nil {
727-
return nil, ierrors.Wrapf(err, "error while checking whether account with output id %s is unspent", accountMetadata.OutputID().ToHex())
728-
}
729-
if !isUnspent {
730-
return nil, ierrors.WithMessagef(mempool.ErrStateNotFound, "unspent account with output id %s not found", accountMetadata.OutputID().ToHex())
731-
}
732-
733725
accountOutput, err := l.utxoLedger.ReadOutputByOutputIDWithoutLocking(accountMetadata.OutputID())
734726
if err != nil {
735727
return nil, ierrors.Wrapf(err, "error while retrieving account with output id %s", accountMetadata.OutputID().ToHex())

0 commit comments

Comments
 (0)