mirror of
https://github.com/Qortal/qortal.git
synced 2025-07-26 03:31:23 +00:00
Require references to be the correct length post feature-trigger
This commit is contained in:
@@ -20,6 +20,7 @@ import org.qortal.repository.DataException;
|
||||
import org.qortal.repository.Repository;
|
||||
import org.qortal.arbitrary.ArbitraryDataFile;
|
||||
import org.qortal.transform.TransformationException;
|
||||
import org.qortal.transform.Transformer;
|
||||
import org.qortal.transform.transaction.ArbitraryTransactionTransformer;
|
||||
import org.qortal.transform.transaction.TransactionTransformer;
|
||||
import org.qortal.utils.ArbitraryTransactionUtils;
|
||||
@@ -90,8 +91,9 @@ public class ArbitraryTransaction extends Transaction {
|
||||
|
||||
// Disable reference checking after feature trigger timestamp
|
||||
if (this.arbitraryTransactionData.getTimestamp() >= BlockChain.getInstance().getDisableReferenceTimestamp()) {
|
||||
// Allow any non-null value
|
||||
return this.arbitraryTransactionData.getReference() != null;
|
||||
// Allow any value as long as it is the correct length
|
||||
return this.arbitraryTransactionData.getReference() != null &&
|
||||
this.arbitraryTransactionData.getReference().length == Transformer.SIGNATURE_LENGTH;
|
||||
}
|
||||
|
||||
if (this.arbitraryTransactionData.getReference() == null) {
|
||||
|
@@ -13,6 +13,7 @@ import org.qortal.data.transaction.TransactionData;
|
||||
import org.qortal.repository.DataException;
|
||||
import org.qortal.repository.Repository;
|
||||
import org.qortal.transform.TransformationException;
|
||||
import org.qortal.transform.Transformer;
|
||||
import org.qortal.transform.transaction.AtTransactionTransformer;
|
||||
import org.qortal.utils.Amounts;
|
||||
|
||||
@@ -78,8 +79,9 @@ public class AtTransaction extends Transaction {
|
||||
public boolean hasValidReference() throws DataException {
|
||||
// Disable reference checking after feature trigger timestamp
|
||||
if (this.atTransactionData.getTimestamp() >= BlockChain.getInstance().getDisableReferenceTimestamp()) {
|
||||
// Allow any non-null value
|
||||
return this.atTransactionData.getReference() != null;
|
||||
// Allow any value as long as it is the correct length
|
||||
return this.atTransactionData.getReference() != null &&
|
||||
this.atTransactionData.getReference().length == Transformer.SIGNATURE_LENGTH;
|
||||
}
|
||||
|
||||
// Check reference is correct, using AT account, not transaction creator which is null account
|
||||
|
@@ -21,6 +21,7 @@ import org.qortal.repository.DataException;
|
||||
import org.qortal.repository.GroupRepository;
|
||||
import org.qortal.repository.Repository;
|
||||
import org.qortal.transform.TransformationException;
|
||||
import org.qortal.transform.Transformer;
|
||||
import org.qortal.transform.transaction.ChatTransactionTransformer;
|
||||
import org.qortal.transform.transaction.MessageTransactionTransformer;
|
||||
import org.qortal.transform.transaction.TransactionTransformer;
|
||||
@@ -167,8 +168,9 @@ public class MessageTransaction extends Transaction {
|
||||
|
||||
// Disable reference checking after feature trigger timestamp
|
||||
if (this.messageTransactionData.getTimestamp() >= BlockChain.getInstance().getDisableReferenceTimestamp()) {
|
||||
// Allow any non-null value
|
||||
return this.messageTransactionData.getReference() != null;
|
||||
// Allow any value as long as it is the correct length
|
||||
return this.messageTransactionData.getReference() != null &&
|
||||
this.messageTransactionData.getReference().length == Transformer.SIGNATURE_LENGTH;
|
||||
}
|
||||
|
||||
if (this.messageTransactionData.getReference() == null)
|
||||
|
@@ -31,6 +31,7 @@ import org.qortal.repository.GroupRepository;
|
||||
import org.qortal.repository.Repository;
|
||||
import org.qortal.settings.Settings;
|
||||
import org.qortal.transform.TransformationException;
|
||||
import org.qortal.transform.Transformer;
|
||||
import org.qortal.transform.transaction.TransactionTransformer;
|
||||
import org.qortal.utils.NTP;
|
||||
|
||||
@@ -907,8 +908,9 @@ public abstract class Transaction {
|
||||
public boolean hasValidReference() throws DataException {
|
||||
// Disable reference checking after feature trigger timestamp
|
||||
if (this.transactionData.getTimestamp() >= BlockChain.getInstance().getDisableReferenceTimestamp()) {
|
||||
// Allow any non-null value
|
||||
return this.transactionData.getReference() != null;
|
||||
// Allow any value as long as it is the correct length
|
||||
return this.transactionData.getReference() != null &&
|
||||
this.transactionData.getReference().length == Transformer.SIGNATURE_LENGTH;
|
||||
}
|
||||
|
||||
Account creator = getCreator();
|
||||
|
Reference in New Issue
Block a user