private void persistBlocksAndTransactions ( EthBlock block ) { Block blk = EtherObjectConverterUtil . convertEtherBlockToKunderaBlock ( block , false ) ; try { em . persist ( blk ) ; LOGGER . debug ( "Block number " + getBlockNumberWithRawData ( blk . getNumber ( ) ) + " is stored!" ) ; } catch ( Exception ex ) { LOGGER . error ( "Block number " + getBlockNumberWithRawData ( blk . getNumber ( ) ) + " is not stored. " , ex ) ; throw new KunderaException ( "Block number " + getBlockNumberWithRawData ( blk . getNumber ( ) ) + " is not stored. " , ex ) ; } for ( TransactionResult tx : block . getResult ( ) . getTransactions ( ) ) { persistTransactions ( EtherObjectConverterUtil . convertEtherTxToKunderaTx ( tx ) , blk . getNumber ( ) ) ; } em . clear ( ) ; }
Persist blocks and transactions .