Class TransactionFeeCalculator


  • public class TransactionFeeCalculator
    extends Object
    Author:
    Giovanni Antino
    • Constructor Detail

      • TransactionFeeCalculator

        public TransactionFeeCalculator()
    • Method Detail

      • getPayBeanAndApplyToBalanceThePay

        public static RewardBean getPayBeanAndApplyToBalanceThePay​(TransactionBox tbox,
                                                                   BalanceBean payer)
        This function alters the payer's balance sheet. This function must be called only after verifying that the payer can afford to execute the transaction. The verification is carried out through canPayFee == true. If the function is called on a payer with an unsustainable balance sheet, it will give rise to a negative balance sheet.
        Parameters:
        tbox -
        payer -
        Returns:
        the reward due to the node for the execution of the current transaction
      • canPayFee

        public static boolean canPayFee​(TransactionBox tbox,
                                        BalanceBean payer)
        For transactions that do not move money but have a cost that is assessed based on the structure alone. These include stake, stake_undo, all register assignments and deregisters.
        Parameters:
        tbox -
        payer -
        Returns: