From 239496999cc29f3f184f8f419279a5fa924b493e Mon Sep 17 00:00:00 2001 From: Alexander Sporn Date: Mon, 6 Nov 2023 08:39:19 +0100 Subject: [PATCH] Add comment to safemath.SafeSub usage --- pkg/protocol/engine/ledger/ledger/ledger.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/protocol/engine/ledger/ledger/ledger.go b/pkg/protocol/engine/ledger/ledger/ledger.go index 1cf863a6f..47ccd7d68 100644 --- a/pkg/protocol/engine/ledger/ledger/ledger.go +++ b/pkg/protocol/engine/ledger/ledger/ledger.go @@ -181,7 +181,7 @@ func (l *Ledger) CommitSlot(slot iotago.SlotIndex) (stateRoot iotago.Identifier, // Update the Accounts ledger // first, get the RMC corresponding to this slot protocolParams := l.apiProvider.APIForSlot(slot).ProtocolParameters() - rmcSlot, _ := safemath.SafeSub(slot, protocolParams.MaxCommittableAge()) + rmcSlot, _ := safemath.SafeSub(slot, protocolParams.MaxCommittableAge()) // We can safely ignore the underflow error and use the default 0 return value if rmcSlot < protocolParams.GenesisSlot() { rmcSlot = protocolParams.GenesisSlot() }