Skip to content

Commit

Permalink
fix: PRT - fixing total stake amount taking only stake size into cons…
Browse files Browse the repository at this point in the history
…ideration (#1746)
  • Loading branch information
ranlavanet authored Oct 17, 2024
1 parent 13593b4 commit 66e7b83
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion protocol/statetracker/updaters/pairing_updater.go
Original file line number Diff line number Diff line change
Expand Up @@ -248,12 +248,17 @@ func (pu *PairingUpdater) filterPairingListByEndpoint(ctx context.Context, curre
pairingEndpoints[idx] = endp
}
lavasession.SortByGeolocations(pairingEndpoints, currentGeo)
totalStakeAmount := provider.Stake.Amount
if !provider.DelegateTotal.Amount.IsNil() {
totalStakeAmount = totalStakeAmount.Add(provider.DelegateTotal.Amount)
}
totalStakeIncludingDelegation := sdk.Coin{Denom: provider.Stake.Denom, Amount: totalStakeAmount}
pairing[uint64(providerIdx)] = lavasession.NewConsumerSessionWithProvider(
provider.Address,
pairingEndpoints,
maxCu,
epoch,
provider.Stake,
totalStakeIncludingDelegation,
)
}
if len(pairing) == 0 {
Expand Down

0 comments on commit 66e7b83

Please sign in to comment.