forked from Qortal/qortal
We (currently) can't filter unconfirmed transactions by address, because only the public key is stored in the database until it is confirmed (at which point there is an entry in the TransactionParticipants table which contains the address). Given that this isn't a simple problem to solve, for now it makes sense to reject this combination if requested via the /transactions/search API.
This commit is contained in:
parent
c4f763960c
commit
7aed0354f1
@ -349,6 +349,10 @@ public class TransactionsResource {
|
||||
if (confirmationStatus != ConfirmationStatus.CONFIRMED && (startBlock != null || blockLimit != null))
|
||||
throw ApiExceptionFactory.INSTANCE.createException(request, ApiError.INVALID_CRITERIA);
|
||||
|
||||
// You can't ask for unconfirmed and filter by address (due to only public key being stored when unconfirmed)
|
||||
if (confirmationStatus != ConfirmationStatus.CONFIRMED && address != null && !address.isEmpty())
|
||||
throw ApiExceptionFactory.INSTANCE.createException(request, ApiError.INVALID_CRITERIA);
|
||||
|
||||
try (final Repository repository = RepositoryManager.getRepository()) {
|
||||
List<byte[]> signatures = repository.getTransactionRepository().getSignaturesMatchingCriteria(startBlock, blockLimit, txGroupId,
|
||||
txTypes, null, null, address, confirmationStatus, limit, offset, reverse);
|
||||
|
Loading…
Reference in New Issue
Block a user