Avoid accounts destroyed in payments from being aux (#318)

This commit is contained in:
Gav Wood
2018-07-15 14:04:26 +02:00
committed by GitHub
parent 5924b361a3
commit f982801ed7
2 changed files with 2 additions and 6 deletions
@@ -876,7 +876,7 @@ impl<T: Trait> MakePayment<T::AccountId> for Module<T> {
fn make_payment(transactor: &T::AccountId, encoded_len: usize) -> Result {
let b = Self::free_balance(transactor);
let transaction_fee = Self::transaction_base_fee() + Self::transaction_byte_fee() * <T::Balance as As<u64>>::sa(encoded_len as u64);
if b < transaction_fee {
if b < transaction_fee + Self::existential_deposit() {
return Err("not enough funds for transaction fee");
}
<FreeBalance<T>>::insert(transactor, b - transaction_fee);