'Recalculate the fee.  If the fee was manually input, retain it, but
still build the TX to see if there are enough funds.'

def do_update_fee(self):

    if ((not self.config.get('offline')) and self.config.is_dynfee() and (not self.config.has_fee_estimates())):
        self.statusBar().showMessage(_('Waiting    for    fee    estimates...'))
        return False
    freeze_fee = (self.fee_e.isModified() and (self.fee_e.text() or self.fee_e.hasFocus()))
    amount = ('!' if self.is_max else self.amount_e.get_amount())
    if (amount is None):
        if (not freeze_fee):
            self.fee_e.setAmount(None)
        self.not_enough_funds = False
        self.statusBar().showMessage('')
    else:
        fee = (self.fee_e.get_amount() if freeze_fee else None)
        outputs = self.payto_e.get_outputs(self.is_max)
        if (not outputs):
            (_type, addr) = self.get_payto_or_dummy()
            outputs = [(_type, addr, amount)]
        try:
            tx = self.wallet.make_unsigned_transaction(self.get_coins(), outputs, self.config, fee)
            self.not_enough_funds = False
        except NotEnoughFunds:
            self.not_enough_funds = True
            if (not freeze_fee):
                self.fee_e.setAmount(None)
            return
        except BaseException:
            return
        if (not freeze_fee):
            fee = (None if self.not_enough_funds else tx.get_fee())
            self.fee_e.setAmount(fee)
        if self.is_max:
            amount = tx.output_value()
            self.amount_e.setAmount(amount)
        if (fee is None):
            return
        rbf_policy = self.config.get('rbf_policy', 1)
        if (rbf_policy == 0):
            b = True
        elif (rbf_policy == 1):
            fee_rate = ((fee * 1000) / tx.estimated_size())
            try:
                c = self.config.reverse_dynfee(fee_rate)
                b = (c in [(-1), 25])
            except:
                b = False
        elif (rbf_policy == 2):
            b = False
        self.rbf_checkbox.setVisible(b)
        self.rbf_checkbox.setChecked(b)
