Search in sources :

Example 1 with AionPendingStateImpl

use of org.aion.zero.impl.blockchain.AionPendingStateImpl in project aion by aionnetwork.

the class ApiAion method getBlockTemplate.

public AionBlock getBlockTemplate() {
    // TODO: Change to follow onBlockTemplate event mode defined in internal
    // miner
    // TODO: Track multiple block templates
    AionBlock bestPendingState = ((AionPendingStateImpl) ac.getAionHub().getPendingState()).getBestBlock();
    AionPendingStateImpl.TransactionSortedSet ret = new AionPendingStateImpl.TransactionSortedSet();
    ret.addAll(ac.getAionHub().getPendingState().getPendingTransactions());
    return ac.getAionHub().getBlockchain().createNewBlock(bestPendingState, new ArrayList<>(ret), false);
}
Also used : AionPendingStateImpl(org.aion.zero.impl.blockchain.AionPendingStateImpl) AionBlock(org.aion.zero.impl.types.AionBlock)

Aggregations

AionPendingStateImpl (org.aion.zero.impl.blockchain.AionPendingStateImpl)1 AionBlock (org.aion.zero.impl.types.AionBlock)1