Remove duplicate check in refreshTTL

The current check verifies that the stored Payload.ownerPubKey == stored Entry.ownerPubKey.

This is the same check that was done when the item was originally added
and there is no reason to do it again.
This commit is contained in:
Julian Knutsen 2019-11-07 18:02:42 -08:00
parent 28a7bc887c
commit 0c07883c17
No known key found for this signature in database
GPG key ID: D85F536DB3615B2D

View file

@ -465,12 +465,7 @@ public class P2PDataStorage implements MessageListener, ConnectionListener, Pers
return false;
// Verify the updated ProtectedStorageEntry is well formed and valid for update
if (!checkSignature(updatedEntry))
return false;
// Verify the Payload owner and the Entry owner for the stored Entry are the same
// TODO: This is also checked in the validation for the original add(), investigate if this can be removed
if (!checkIfStoredDataPubKeyMatchesNewDataPubKey(updatedEntry.getOwnerPubKey(), hashOfPayload))
if (!updatedEntry.isValidForAddOperation())
return false;
// Update the hash map with the updated entry