if (isFull()) { LinkEntry<K, V> reuse = header.after; boolean removeLRUEntry = false;
/** * Adds TransactionInfo to the store. * If entries for this transaction already exist the method adds new entry to the list * if no entry for the same block exists * @return true if TransactionInfo was added, false if already exist */ public boolean put(TransactionInfo tx) { byte[] txHash = tx.getReceipt().getTransaction().getHash(); List<TransactionInfo> existingInfos = null; synchronized (lastSavedTxHash) { if (lastSavedTxHash.put(new ByteArrayWrapper(txHash), object) != null || !lastSavedTxHash.isFull()) { existingInfos = get(txHash); } } // else it is highly unlikely that the transaction was included into another block // earlier than 5000 transactions before with regard to regular block import process if (existingInfos == null) { existingInfos = new ArrayList<>(); } else { for (TransactionInfo info : existingInfos) { if (FastByteComparisons.equal(info.getBlockHash(), tx.getBlockHash())) { return false; } } } existingInfos.add(tx); put(txHash, existingInfos); return true; }