etherscan-explorer icon indicating copy to clipboard operation
etherscan-explorer copied to clipboard

If need add the from address into account -- ConverterFunctionUtil

Open xeyesu opened this issue 6 years ago • 1 comments

Function<EthBlock.Block, List<Account>> toAccounts
    = blk -> {
        Set<Account> accountSet = new HashSet<>();
        accountSet.add(new Account.Builder().hash(blk.getMiner()).build());
        for (EthBlock.TransactionResult txResult : blk.getTransactions()) {

            EthBlock.TransactionObject tx = (EthBlock.TransactionObject) txResult;
            if (null != tx.getTo()) {
                accountSet.add(new Account.Builder().hash(tx.getTo()).build());
            }
            //xys
            //TODO: if need add the from address into account list???
        }
        return new ArrayList<>(accountSet);
    };

xeyesu avatar Sep 13 '18 11:09 xeyesu

As far as I'm concerned, "toAddress" is enough if considering UTXO model.

bing-chou avatar Sep 18 '18 03:09 bing-chou