Revert "deliver a decay block every time"

This commit is contained in:
Hannes Heine 2021-10-15 12:02:14 +02:00 committed by GitHub
parent bf6a3419d5
commit cc9e3b54c9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -82,6 +82,7 @@ async function calculateAndAddDecayTransactions(
) )
const balance = prev.balance - decay.balance const balance = prev.balance - decay.balance
if (balance) {
finalTransaction.decay = decay finalTransaction.decay = decay
finalTransaction.decay.balance = roundFloorFrom4(balance) finalTransaction.decay.balance = roundFloorFrom4(balance)
if ( if (
@ -94,6 +95,7 @@ async function calculateAndAddDecayTransactions(
).toString() ).toString()
} }
} }
}
// sender or receiver when user has sent money // sender or receiver when user has sent money
// group name if creation // group name if creation
@ -142,7 +144,7 @@ async function calculateAndAddDecayTransactions(
now.getTime(), now.getTime(),
) )
const balance = userTransaction.balance - decay.balance const balance = userTransaction.balance - decay.balance
if (balance) {
const decayTransaction = new Transaction() const decayTransaction = new Transaction()
decayTransaction.type = 'decay' decayTransaction.type = 'decay'
decayTransaction.balance = roundFloorFrom4(balance) decayTransaction.balance = roundFloorFrom4(balance)
@ -152,6 +154,7 @@ async function calculateAndAddDecayTransactions(
finalTransactions.push(decayTransaction) finalTransactions.push(decayTransaction)
} }
} }
}
return finalTransactions return finalTransactions
} }