Modified post-trigger last reference checking, to now require a non-null value

This allows for compatibility with TRANSFER_PRIVS validation in commit 8950bb7, which treats any account with a non-null reference as "existing". It also avoids possible unknown side effects from trying to process and store transactions with a null reference - something that wouldn't have been possible until the validation was removed.
This commit is contained in:
CalDescent
2022-05-30 13:22:15 +02:00
parent f887fcafe3
commit 922ffcc0be
5 changed files with 34 additions and 4 deletions

View File

@@ -90,7 +90,8 @@ public class ArbitraryTransaction extends Transaction {
// Disable reference checking after feature trigger timestamp
if (this.arbitraryTransactionData.getTimestamp() >= BlockChain.getInstance().getDisableReferenceTimestamp()) {
return true;
// Allow any non-null value
return this.arbitraryTransactionData.getReference() != null;
}
if (this.arbitraryTransactionData.getReference() == null) {

View File

@@ -78,7 +78,8 @@ public class AtTransaction extends Transaction {
public boolean hasValidReference() throws DataException {
// Disable reference checking after feature trigger timestamp
if (this.atTransactionData.getTimestamp() >= BlockChain.getInstance().getDisableReferenceTimestamp()) {
return true;
// Allow any non-null value
return this.atTransactionData.getReference() != null;
}
// Check reference is correct, using AT account, not transaction creator which is null account

View File

@@ -167,7 +167,8 @@ public class MessageTransaction extends Transaction {
// Disable reference checking after feature trigger timestamp
if (this.messageTransactionData.getTimestamp() >= BlockChain.getInstance().getDisableReferenceTimestamp()) {
return true;
// Allow any non-null value
return this.messageTransactionData.getReference() != null;
}
if (this.messageTransactionData.getReference() == null)

View File

@@ -907,7 +907,8 @@ public abstract class Transaction {
public boolean hasValidReference() throws DataException {
// Disable reference checking after feature trigger timestamp
if (this.transactionData.getTimestamp() >= BlockChain.getInstance().getDisableReferenceTimestamp()) {
return true;
// Allow any non-null value
return this.transactionData.getReference() != null;
}
Account creator = getCreator();