Browse Source

Don't broadcast that we are holding files for a transaction unless it's within the scope of our storage policy.

We may need to temporarily hold files for the purpose of viewing, but restrictions need to be in place to avoid these being served to peers of stored for longer than they are needed.
qdn
CalDescent 3 years ago
parent
commit
5e82de667e
  1. 5
      src/main/java/org/qortal/controller/arbitrary/ArbitraryDataManager.java

5
src/main/java/org/qortal/controller/arbitrary/ArbitraryDataManager.java

@ -514,11 +514,14 @@ public class ArbitraryDataManager extends Thread {
// data cache so that it is rebuilt the next time we serve it
invalidateCache(arbitraryTransactionData);
// We also need to broadcast to the network that we are now hosting files for this transaction
// We may also need to broadcast to the network that we are now hosting files for this transaction,
// but only if these files are in accordance with our storage policy (we may have requested them for viewing only)
if (ArbitraryDataStorageManager.getInstance().shouldStoreDataForName(arbitraryTransactionData.getName())) {
// Use a null peer address to indicate our own
Message newArbitrarySignatureMessage = new ArbitrarySignaturesMessage(null, Arrays.asList(signature));
Network.getInstance().broadcast(broadcastPeer -> newArbitrarySignatureMessage);
}
}
} catch (DataException | InterruptedException e) {
LOGGER.error(String.format("Repository issue while finding arbitrary transaction data list for peer %s", peer), e);

Loading…
Cancel
Save