Update backend/src/util/decay.ts

Co-authored-by: Ulf Gebhardt <ulf.gebhardt@webcraft-media.de>
This commit is contained in:
einhornimmond 2021-09-30 18:52:12 +02:00 committed by GitHub
parent bf8bd24abf
commit d4d19b7801
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -32,7 +32,7 @@ async function calculateDecayWithInterval(
// (amount, from.getTime(), to.getTime())
// if no decay start block exist or decay startet after end date
if (decayStartBlock === undefined || decayStartBlock.received.getTime() > toMillis) {
if (!decayStartBlock || decayStartBlock.received.getTime() > toMillis) {
return result
}
const decayStartBlockMillis = decayStartBlock.received.getTime()