Add getAllRecentTransactions method.

The numTransactions param in getRecentTransactions delivers all transactions if it is 0 but that is not intuitive. Passing Integer.MAX_VALUE makes more sense.

Signed-off-by: HenrikJannsen <boilingfrog@gmx.com>
This commit is contained in:
HenrikJannsen 2023-05-04 11:26:02 +07:00
parent acbff2b11a
commit 966b9d8448
No known key found for this signature in database
GPG Key ID: 02AA2BAE387C8307

View File

@ -461,8 +461,8 @@ public abstract class WalletService {
.map(tx -> getTransactionConfidence(tx, address))
.filter(Objects::nonNull)
.filter(con -> con.getConfidenceType() == TransactionConfidence.ConfidenceType.PENDING ||
(con.getConfidenceType() == TransactionConfidence.ConfidenceType.BUILDING &&
con.getAppearedAtChainHeight() > targetHeight))
(con.getConfidenceType() == TransactionConfidence.ConfidenceType.BUILDING &&
con.getAppearedAtChainHeight() > targetHeight))
.collect(Collectors.toList()));
}
return getMostRecentConfidence(transactionConfidenceList);
@ -751,6 +751,10 @@ public abstract class WalletService {
return wallet.isEncrypted();
}
public List<Transaction> getAllRecentTransactions(boolean includeDead) {
return getRecentTransactions(Integer.MAX_VALUE, includeDead);
}
public List<Transaction> getRecentTransactions(int numTransactions, boolean includeDead) {
// Returns a list ordered by tx.getUpdateTime() desc
return wallet.getRecentTransactions(numTransactions, includeDead);