Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Observable<Transaction> myCatchUpToLatestAndSubscribeToNewTransactionsObservable(
- DefaultBlockParameter startBlock) {
- return web3j.catchUpToLatestAndSubscribeToNewBlocksObservable(startBlock, false)
- .flatMap(currentBlock -> {
- BigInteger confirmedBlock = currentBlock.getBlock().getNumber().subtract(confirmationBlock);
- return web3j.ethGetBlockByNumber(DefaultBlockParameter.valueOf(confirmedBlock), true).observable();
- }).flatMapIterable(MyWeb3j::toTransactions);
- }
Add Comment
Please, Sign In to add comment