Making LnInvoice amount a Lazy property.

This commit is contained in:
Vitor Pamplona
2023-03-08 08:43:38 -05:00
parent 7275799f9d
commit 9f5b3d82c5
@@ -36,7 +36,9 @@ class LnZapEvent(
}
// Keeps this as a field because it's a heavier function used everywhere.
val amount = lnInvoice()?.let { LnInvoiceUtil.getAmountInSats(it) }
val amount by lazy {
lnInvoice()?.let { LnInvoiceUtil.getAmountInSats(it) }
}
override fun containedPost(): Event? = try {
description()?.let {