[ #1099] Proper transaction state

This commit is contained in:
Honza Rychnovský 2023-07-05 14:18:22 +02:00 committed by GitHub
parent dc330228ff
commit 89ee0190af
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -73,8 +73,10 @@ enum class TransactionState {
minedHeight: BlockHeight?,
expiryHeight: BlockHeight?
): TransactionState {
return if (minedHeight != null && (latestBlockHeight.value - minedHeight.value) > MIN_CONFIRMATIONS) {
return if (minedHeight != null && (latestBlockHeight.value - minedHeight.value) >= MIN_CONFIRMATIONS) {
Confirmed
} else if (minedHeight != null && (latestBlockHeight.value - minedHeight.value) < MIN_CONFIRMATIONS) {
Pending
} else if (minedHeight == null && ((expiryHeight?.value ?: Long.MAX_VALUE) < latestBlockHeight.value)) {
Pending
} else {