Skip to content

Commit e6877ef

Browse files
committed
Merge remote-tracking branch 'origin/trivuele-stop-storing-blocks-twice' into next
2 parents a65b766 + b87fe7e commit e6877ef

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/freenet/node/Node.java

+7-5
Original file line numberDiff line numberDiff line change
@@ -3731,7 +3731,7 @@ public void storeShallow(CHKBlock block, boolean canWriteClientCache, boolean ca
37313731
* Store a datum.
37323732
* @param block
37333733
* a KeyBlock
3734-
* @param deep If true, insert to the store as well as the cache. Do not set
3734+
* @param deep If true, insert to the store rather than the cache. Do not set
37353735
* this to true unless the store results from an insert, and this node is the
37363736
* closest node to the target; see the description of chkDatastore.
37373737
*/
@@ -3761,9 +3761,10 @@ private void store(CHKBlock block, boolean deep, boolean canWriteClientCache, bo
37613761
chkDatastore.put(block, !canWriteDatastore);
37623762
nodeStats.avgStoreCHKLocation.report(loc);
37633763

3764+
} else {
3765+
chkDatacache.put(block, !canWriteDatastore);
3766+
nodeStats.avgCacheCHKLocation.report(loc);
37643767
}
3765-
chkDatacache.put(block, !canWriteDatastore);
3766-
nodeStats.avgCacheCHKLocation.report(loc);
37673768
}
37683769
if (canWriteDatastore || forULPR || useSlashdotCache)
37693770
failureTable.onFound(block);
@@ -3809,9 +3810,10 @@ public void store(SSKBlock block, boolean deep, boolean overwrite, boolean canWr
38093810
if(deep) {
38103811
sskDatastore.put(block, overwrite, !canWriteDatastore);
38113812
nodeStats.avgStoreSSKLocation.report(loc);
3813+
} else {
3814+
sskDatacache.put(block, overwrite, !canWriteDatastore);
3815+
nodeStats.avgCacheSSKLocation.report(loc);
38123816
}
3813-
sskDatacache.put(block, overwrite, !canWriteDatastore);
3814-
nodeStats.avgCacheSSKLocation.report(loc);
38153817
}
38163818
if(canWriteDatastore || forULPR || useSlashdotCache)
38173819
failureTable.onFound(block);

0 commit comments

Comments
 (0)