Guest User

Untitled

a guest
Oct 15th, 2018
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. Observable<Transaction> myCatchUpToLatestAndSubscribeToNewTransactionsObservable(
  2. DefaultBlockParameter startBlock) {
  3.  
  4.  
  5. return web3j.catchUpToLatestAndSubscribeToNewBlocksObservable(startBlock, false)
  6. .flatMap(currentBlock -> {
  7. BigInteger confirmedBlock = currentBlock.getBlock().getNumber().subtract(confirmationBlock);
  8. return web3j.ethGetBlockByNumber(DefaultBlockParameter.valueOf(confirmedBlock), true).observable();
  9. }).flatMapIterable(MyWeb3j::toTransactions);
  10. }
Add Comment
Please, Sign In to add comment