forked from Qortal/qortal
Disallow CHAT transactions with timestamps more than 5 minutes in the future.
This commit is contained in:
parent
99d5bf9103
commit
08de1fb4ec
@ -19,6 +19,7 @@ import org.qortal.repository.Repository;
|
||||
import org.qortal.transform.TransformationException;
|
||||
import org.qortal.transform.transaction.ChatTransactionTransformer;
|
||||
import org.qortal.transform.transaction.TransactionTransformer;
|
||||
import org.qortal.utils.NTP;
|
||||
|
||||
public class ChatTransaction extends Transaction {
|
||||
|
||||
@ -145,6 +146,11 @@ public class ChatTransaction extends Transaction {
|
||||
public ValidationResult isValid() throws DataException {
|
||||
// Nonce checking is done via isSignatureValid() as that method is only called once per import
|
||||
|
||||
// Disregard messages with timestamp too far in the future (we have stricter limits for CHAT transactions)
|
||||
if (this.chatTransactionData.getTimestamp() > NTP.getTime() + (5 * 60 * 1000L)) {
|
||||
return ValidationResult.TIMESTAMP_TOO_NEW;
|
||||
}
|
||||
|
||||
// Check for blocked author by address
|
||||
ResourceListManager listManager = ResourceListManager.getInstance();
|
||||
if (listManager.listContains("blockedAddresses", this.chatTransactionData.getSender(), true)) {
|
||||
|
Loading…
Reference in New Issue
Block a user