mirror of
https://github.com/mollyim/monero-wallet-sdk.git
synced 2024-10-01 03:45:36 -04:00
lib: fix unspent txout crash
This commit is contained in:
parent
6811bdf47a
commit
aa5ea643cc
@ -19,17 +19,17 @@ constructor(
|
||||
val spentInBlockHeight: Long,
|
||||
) : Parcelable {
|
||||
|
||||
init {
|
||||
require(blockHeight <= spentInBlockHeight)
|
||||
require(amount >= 0) { "TX amount cannot be negative" }
|
||||
}
|
||||
|
||||
@IgnoredOnParcel
|
||||
val spent: Boolean = spentInBlockHeight != 0L
|
||||
|
||||
@IgnoredOnParcel
|
||||
val notSpent = !spent
|
||||
|
||||
init {
|
||||
require(notSpent || blockHeight <= spentInBlockHeight)
|
||||
require(amount >= 0) { "TX amount $amount cannot be negative" }
|
||||
}
|
||||
|
||||
override fun equals(other: Any?): Boolean {
|
||||
if (this === other) return true
|
||||
if (javaClass != other?.javaClass) return false
|
||||
|
Loading…
Reference in New Issue
Block a user