New: Expose transaction count.

This commit is contained in:
Kevin Gorham 2021-03-31 09:27:57 -04:00
parent ad5d4c4505
commit cde327a0f8
No known key found for this signature in database
GPG Key ID: CCA55602DF49FC38
2 changed files with 5 additions and 1 deletions

View File

@ -91,7 +91,9 @@ open class PagedTransactionRepository(
// let expired transactions linger in the UI for a little while
return transactions.deleteExpired(lastScannedHeight - (ZcashSdk.EXPIRY_OFFSET / 2))
}
override suspend fun count(): Int = withContext(IO) {
transactions.count()
}
/**
* Close the underlying database.
*/

View File

@ -74,6 +74,8 @@ interface TransactionRepository {
suspend fun deleteExpired(lastScannedHeight: Int): Int
suspend fun count(): Int
//
// Transactions
//