Skip to content

Commit

Permalink
muxxer suggestion
Browse files Browse the repository at this point in the history
  • Loading branch information
cyberphysic4l committed Apr 16, 2024
1 parent 789a1f4 commit 042ea6b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/requesthandler/accounts.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,15 @@ func (r *RequestHandler) CongestionByAccountAddress(accountAddress *iotago.Accou

blockIssuanceCredits := acc.Credits.Value
// Apply decay to BIC if the value is positive
if acc.Credits.Value > 0 {
if blockIssuanceCredits > 0 {
manaDecayProvider := r.APIProvider().APIForSlot(commitment.Slot()).ManaDecayProvider()
decayedBIC, err := manaDecayProvider.DecayManaBySlots(iotago.Mana(acc.Credits.Value), acc.Credits.UpdateSlot, commitment.Slot())
if err != nil {
return nil, ierrors.WithMessagef(echo.ErrInternalServerError, "failed to decay BIC for account %s: %w", accountID.ToHex(), err)
}
blockIssuanceCredits = iotago.BlockIssuanceCredits(decayedBIC)
}

return &api.CongestionResponse{
Slot: commitment.Slot(),
Ready: r.protocol.Engines.Main.Get().Scheduler.IsBlockIssuerReady(accountID, workScores...),
Expand Down

0 comments on commit 042ea6b

Please sign in to comment.