forked from Qortal/qortal
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.
This commit is contained in:
parent
d7ddcda9da
commit
5e82de667e
@ -514,10 +514,13 @@ 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
|
||||
// Use a null peer address to indicate our own
|
||||
Message newArbitrarySignatureMessage = new ArbitrarySignaturesMessage(null, Arrays.asList(signature));
|
||||
Network.getInstance().broadcast(broadcastPeer -> newArbitrarySignatureMessage);
|
||||
// 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) {
|
||||
|
Loading…
Reference in New Issue
Block a user