MCPcopy Index your code
hub / github.com/chain/Core / next

Method next

sdk/java/src/main/java/com/chain/api/Transaction.java:1157–1172  ·  view source on GitHub ↗

Retrieves the next transaction matching the feed's filter criteria. If no such transaction is available, this method will block until a matching transaction arrives in the blockchain, or if the specified timeout is reached. To avoid client-side timeouts, be sure to call {@link Client#setReadTimeout(

(Client client, long timeout)

Source from the content-addressed store, hash-verified

1155 * @throws ChainException
1156 */
1157 public Transaction next(Client client, long timeout) throws ChainException {
1158 if (txIter == null || !txIter.hasNext()) {
1159 txIter =
1160 new QueryBuilder()
1161 .setFilter(filter)
1162 .setAfter(after)
1163 .setTimeout(timeout)
1164 .setAscendingWithLongPoll()
1165 .execute(client)
1166 .list
1167 .listIterator();
1168 }
1169
1170 lastTx = txIter.next();
1171 return lastTx;
1172 }
1173
1174 /**
1175 * Retrieves the next transaction matching the feed's filter criteria.

Callers

nothing calls this directly

Calls 6

hasNextMethod · 0.80
setAfterMethod · 0.80
setFilterMethod · 0.80
executeMethod · 0.45
setTimeoutMethod · 0.45

Tested by

no test coverage detected