mirror of
https://github.com/Qortal/qortal.git
synced 2025-04-23 11:27:51 +00:00
Exclude RAW_DATA arbitrary transactions from various arbitrary data controller methods.
This commit is contained in:
parent
1f9f949a8c
commit
302428f1d1
@ -112,6 +112,11 @@ public class ArbitraryDataStorageManager extends Thread {
|
|||||||
public boolean canStoreData(ArbitraryTransactionData arbitraryTransactionData) {
|
public boolean canStoreData(ArbitraryTransactionData arbitraryTransactionData) {
|
||||||
String name = arbitraryTransactionData.getName();
|
String name = arbitraryTransactionData.getName();
|
||||||
|
|
||||||
|
// We already have RAW_DATA on chain, so we only need to store data associated with hashes
|
||||||
|
if (arbitraryTransactionData.getDataType() != ArbitraryTransactionData.DataType.DATA_HASH) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
// Don't store data unless it's an allowed type (public/private)
|
// Don't store data unless it's an allowed type (public/private)
|
||||||
if (!this.isDataTypeAllowed(arbitraryTransactionData)) {
|
if (!this.isDataTypeAllowed(arbitraryTransactionData)) {
|
||||||
return false;
|
return false;
|
||||||
@ -148,6 +153,11 @@ public class ArbitraryDataStorageManager extends Thread {
|
|||||||
public boolean shouldPreFetchData(Repository repository, ArbitraryTransactionData arbitraryTransactionData) {
|
public boolean shouldPreFetchData(Repository repository, ArbitraryTransactionData arbitraryTransactionData) {
|
||||||
String name = arbitraryTransactionData.getName();
|
String name = arbitraryTransactionData.getName();
|
||||||
|
|
||||||
|
// Only fetch data associated with hashes, as we already have RAW_DATA
|
||||||
|
if (arbitraryTransactionData.getDataType() != ArbitraryTransactionData.DataType.DATA_HASH) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
// Don't fetch anything more if we're (nearly) out of space
|
// Don't fetch anything more if we're (nearly) out of space
|
||||||
// Make sure to keep STORAGE_FULL_THRESHOLD considerably less than 1, to
|
// Make sure to keep STORAGE_FULL_THRESHOLD considerably less than 1, to
|
||||||
// avoid a fetch/delete loop
|
// avoid a fetch/delete loop
|
||||||
|
Loading…
x
Reference in New Issue
Block a user