Browse Source

Removed requirement to have connected peers in order to cleanup directories.

qdn
CalDescent 3 years ago
parent
commit
6cb39795a9
  1. 13
      src/main/java/org/qortal/controller/arbitrary/ArbitraryDataCleanupManager.java

13
src/main/java/org/qortal/controller/arbitrary/ArbitraryDataCleanupManager.java

@ -40,7 +40,6 @@ public class ArbitraryDataCleanupManager extends Thread {
/* /*
TODO: TODO:
- Discard all files relating to transactions for a name/service combination before the most recent PUT
- Delete old files from _temp - Delete old files from _temp
- Delete old files not associated with transactions - Delete old files not associated with transactions
*/ */
@ -77,17 +76,7 @@ public class ArbitraryDataCleanupManager extends Thread {
// Don't attempt to make decisions if we haven't synced our time yet // Don't attempt to make decisions if we haven't synced our time yet
continue; continue;
} }
List<Peer> peers = Network.getInstance().getHandshakedPeers();
// Disregard peers that have "misbehaved" recently
peers.removeIf(Controller.hasMisbehaved);
// Don't fetch data if we don't have enough up-to-date peers
if (peers.size() < Settings.getInstance().getMinBlockchainPeers()) {
continue;
}
// Any arbitrary transactions we want to fetch data for? // Any arbitrary transactions we want to fetch data for?
try (final Repository repository = RepositoryManager.getRepository()) { try (final Repository repository = RepositoryManager.getRepository()) {
List<byte[]> signatures = repository.getTransactionRepository().getSignaturesMatchingCriteria(null, null, null, ARBITRARY_TX_TYPE, null, null, ConfirmationStatus.BOTH, limit, offset, true); List<byte[]> signatures = repository.getTransactionRepository().getSignaturesMatchingCriteria(null, null, null, ARBITRARY_TX_TYPE, null, null, ConfirmationStatus.BOTH, limit, offset, true);

Loading…
Cancel
Save