Store 2050 blocks in the BoundedOverheadBlockStore memory cache. This eliminates the delay on difficulty transitions. We now regularly hit 500 blocks per second, ie, we are sender-constrained.

This commit is contained in:
Mike Hearn 2011-07-06 15:53:50 +00:00
parent af843bc424
commit 85caefbd4d

View File

@ -52,7 +52,7 @@ public class BoundedOverheadBlockStore implements BlockStore {
private LinkedHashMap<Sha256Hash, StoredBlock> blockCache = new LinkedHashMap<Sha256Hash, StoredBlock>() {
@Override
protected boolean removeEldestEntry(Map.Entry<Sha256Hash, StoredBlock> entry) {
return size() > 100; // This was chosen arbitrarily.
return size() > 2050; // Slightly more than the difficulty transition period.
}
};
// Use a separate cache to track get() misses. This is to efficiently handle the case of an unconnected block