Skip to content

Commit

Permalink
Merge pull request #983 from iotaledger/fix/quantum-race
Browse files Browse the repository at this point in the history
Fix Quantum calculation race
  • Loading branch information
alexsporn authored Jun 7, 2024
2 parents 97bab37 + 3002562 commit 3673e39
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions pkg/protocol/engine/ledger/ledger/ledger.go
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down

0 comments on commit 3673e39

Please sign in to comment.