mirror of
https://github.com/bitcoinj/bitcoinj.git
synced 2024-11-20 10:12:19 +01:00
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:
parent
af843bc424
commit
85caefbd4d
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user