getNextTransactions method

Future<TransactionIteratorResults> getNextTransactions (
  1. Peer peer,
  2. Address x
)

Use Peer.getTransactions iterator to load x's Transactions by Transaction.height.

Implementation

Future<TransactionIteratorResults> getNextTransactions(
    Peer peer, Address x) async {
  /// Fetch next block with [Peer.getTransactions] iterator and [updateTransaction].
  TransactionIteratorResults results =
      await peer.getTransactions(x.publicKey, x.loadIterator);
  if (results == null) return null;
  for (Transaction transaction in results.transactions) {
    await updateTransaction(transaction, newTransaction: false);
  }

  x.loadIterator = TransactionIterator(results.height, results.index);
  return results;
}