API State RecommendedFee

This commit is contained in:
laisolizq
2020-11-09 17:01:35 +01:00
parent a1b9720e77
commit 9edf9d2168
4 changed files with 65 additions and 5 deletions

View File

@@ -142,5 +142,12 @@ func (a *API) UpdateMetrics() error {
// UpdateRecommendedFee update Status.RecommendedFee information
func (a *API) UpdateRecommendedFee() error {
feeExistingAccount, err := a.h.GetAvgTxFee()
if err != nil {
return err
}
a.status.RecommendedFee.ExistingAccount = feeExistingAccount
a.status.RecommendedFee.CreatesAccount = createAccountExtraFeePercentage * feeExistingAccount
a.status.RecommendedFee.CreatesAccountAndRegister = createAccountInternalExtraFeePercentage * feeExistingAccount
return nil
}