mirror of
https://github.com/Qortal/qortal.git
synced 2025-06-02 06:26:59 +00:00
Block chat transactions on the local node if its sender owns a name that is blacklisted by the user.
This commit is contained in:
parent
bfffff0750
commit
0d69797851
@ -8,6 +8,7 @@ import org.qortal.account.PublicKeyAccount;
|
|||||||
import org.qortal.asset.Asset;
|
import org.qortal.asset.Asset;
|
||||||
import org.qortal.crypto.Crypto;
|
import org.qortal.crypto.Crypto;
|
||||||
import org.qortal.crypto.MemoryPoW;
|
import org.qortal.crypto.MemoryPoW;
|
||||||
|
import org.qortal.data.naming.NameData;
|
||||||
import org.qortal.data.transaction.ChatTransactionData;
|
import org.qortal.data.transaction.ChatTransactionData;
|
||||||
import org.qortal.data.transaction.TransactionData;
|
import org.qortal.data.transaction.TransactionData;
|
||||||
import org.qortal.group.Group;
|
import org.qortal.group.Group;
|
||||||
@ -150,6 +151,18 @@ public class ChatTransaction extends Transaction {
|
|||||||
return ValidationResult.ADDRESS_IN_BLACKLIST;
|
return ValidationResult.ADDRESS_IN_BLACKLIST;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Check for blacklisted author by registered name
|
||||||
|
List<NameData> names = this.repository.getNameRepository().getNamesByOwner(this.chatTransactionData.getSender());
|
||||||
|
if (names != null && names.size() > 0) {
|
||||||
|
for (NameData nameData : names) {
|
||||||
|
if (nameData != null && nameData.getName() != null) {
|
||||||
|
if (listManager.listContains("blacklist", "names", nameData.getName())) {
|
||||||
|
return ValidationResult.NAME_IN_BLACKLIST;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// If we exist in the repository then we've been imported as unconfirmed,
|
// If we exist in the repository then we've been imported as unconfirmed,
|
||||||
// but we don't want to make it into a block, so return fake non-OK result.
|
// but we don't want to make it into a block, so return fake non-OK result.
|
||||||
if (this.repository.getTransactionRepository().exists(this.chatTransactionData.getSignature()))
|
if (this.repository.getTransactionRepository().exists(this.chatTransactionData.getSignature()))
|
||||||
|
@ -248,6 +248,7 @@ public abstract class Transaction {
|
|||||||
INCORRECT_NONCE(94),
|
INCORRECT_NONCE(94),
|
||||||
INVALID_TIMESTAMP_SIGNATURE(95),
|
INVALID_TIMESTAMP_SIGNATURE(95),
|
||||||
ADDRESS_IN_BLACKLIST(96),
|
ADDRESS_IN_BLACKLIST(96),
|
||||||
|
NAME_IN_BLACKLIST(97),
|
||||||
INVALID_BUT_OK(999),
|
INVALID_BUT_OK(999),
|
||||||
NOT_YET_RELEASED(1000);
|
NOT_YET_RELEASED(1000);
|
||||||
|
|
||||||
|
@ -182,10 +182,12 @@ INVALID_TIMESTAMP_SIGNATURE = invalid timestamp signature
|
|||||||
|
|
||||||
ADDRESS_IN_BLACKLIST = this address is in your blacklist
|
ADDRESS_IN_BLACKLIST = this address is in your blacklist
|
||||||
|
|
||||||
|
NAME_IN_BLACKLIST = this name is in your blacklist
|
||||||
|
|
||||||
ADDRESS_ABOVE_RATE_LIMIT = address reached specified rate limit
|
ADDRESS_ABOVE_RATE_LIMIT = address reached specified rate limit
|
||||||
|
|
||||||
DUPLICATE_MESSAGE = address sent duplicate message
|
DUPLICATE_MESSAGE = address sent duplicate message
|
||||||
|
|
||||||
INVALID_BUT_OK = invalid but OK
|
INVALID_BUT_OK = invalid but OK
|
||||||
|
|
||||||
NOT_YET_RELEASED = feature not yet released
|
NOT_YET_RELEASED = feature not yet released
|
||||||
|
@ -182,10 +182,12 @@ TX_GROUP_ID_MISMATCH = transaktion ryhmä-ID:n vastaavuusvirhe
|
|||||||
|
|
||||||
ADDRESS_IN_BLACKLIST = this address is in your blacklist
|
ADDRESS_IN_BLACKLIST = this address is in your blacklist
|
||||||
|
|
||||||
|
NAME_IN_BLACKLIST = this name is in your blacklist
|
||||||
|
|
||||||
ADDRESS_ABOVE_RATE_LIMIT = address reached specified rate limit
|
ADDRESS_ABOVE_RATE_LIMIT = address reached specified rate limit
|
||||||
|
|
||||||
DUPLICATE_MESSAGE = address sent duplicate message
|
DUPLICATE_MESSAGE = address sent duplicate message
|
||||||
|
|
||||||
INVALID_TIMESTAMP_SIGNATURE = Invalid timestamp signature
|
INVALID_TIMESTAMP_SIGNATURE = Invalid timestamp signature
|
||||||
|
|
||||||
INVALID_BUT_OK = Invalid but OK
|
INVALID_BUT_OK = Invalid but OK
|
||||||
|
@ -184,10 +184,12 @@ INVALID_TIMESTAMP_SIGNATURE = érvénytelen időbélyeg aláírás
|
|||||||
|
|
||||||
ADDRESS_IN_BLACKLIST = ez a fiókcím a fekete listádon van
|
ADDRESS_IN_BLACKLIST = ez a fiókcím a fekete listádon van
|
||||||
|
|
||||||
|
NAME_IN_BLACKLIST = this name is in your blacklist
|
||||||
|
|
||||||
ADDRESS_ABOVE_RATE_LIMIT = ez a cím elérte a megengedett mérték korlátot
|
ADDRESS_ABOVE_RATE_LIMIT = ez a cím elérte a megengedett mérték korlátot
|
||||||
|
|
||||||
DUPLICATE_MESSAGE = ez a cím duplikált üzenetet küldött
|
DUPLICATE_MESSAGE = ez a cím duplikált üzenetet küldött
|
||||||
|
|
||||||
INVALID_BUT_OK = érvénytelen de elfogadva
|
INVALID_BUT_OK = érvénytelen de elfogadva
|
||||||
|
|
||||||
NOT_YET_RELEASED = ez a funkció még nem került kiadásra
|
NOT_YET_RELEASED = ez a funkció még nem került kiadásra
|
||||||
|
@ -184,10 +184,12 @@ TX_GROUP_ID_MISMATCH = identificazione di gruppo della transazione non corrispon
|
|||||||
|
|
||||||
ADDRESS_IN_BLACKLIST = this address is in your blacklist
|
ADDRESS_IN_BLACKLIST = this address is in your blacklist
|
||||||
|
|
||||||
|
NAME_IN_BLACKLIST = this name is in your blacklist
|
||||||
|
|
||||||
ADDRESS_ABOVE_RATE_LIMIT = address reached specified rate limit
|
ADDRESS_ABOVE_RATE_LIMIT = address reached specified rate limit
|
||||||
|
|
||||||
DUPLICATE_MESSAGE = address sent duplicate message
|
DUPLICATE_MESSAGE = address sent duplicate message
|
||||||
|
|
||||||
INVALID_TIMESTAMP_SIGNATURE = Invalid timestamp signature
|
INVALID_TIMESTAMP_SIGNATURE = Invalid timestamp signature
|
||||||
|
|
||||||
INVALID_BUT_OK = Invalid but OK
|
INVALID_BUT_OK = Invalid but OK
|
||||||
|
@ -182,10 +182,12 @@ TX_GROUP_ID_MISMATCH = groep-ID van transactie matcht niet
|
|||||||
|
|
||||||
ADDRESS_IN_BLACKLIST = this address is in your blacklist
|
ADDRESS_IN_BLACKLIST = this address is in your blacklist
|
||||||
|
|
||||||
|
NAME_IN_BLACKLIST = this name is in your blacklist
|
||||||
|
|
||||||
ADDRESS_ABOVE_RATE_LIMIT = address reached specified rate limit
|
ADDRESS_ABOVE_RATE_LIMIT = address reached specified rate limit
|
||||||
|
|
||||||
DUPLICATE_MESSAGE = address sent duplicate message
|
DUPLICATE_MESSAGE = address sent duplicate message
|
||||||
|
|
||||||
INVALID_TIMESTAMP_SIGNATURE = Invalid timestamp signature
|
INVALID_TIMESTAMP_SIGNATURE = Invalid timestamp signature
|
||||||
|
|
||||||
INVALID_BUT_OK = Invalid but OK
|
INVALID_BUT_OK = Invalid but OK
|
||||||
|
Loading…
x
Reference in New Issue
Block a user