forked from Qortal/qortal
Add check to PROXY_FORGING so that proxy public key always maps to same forger-recipient combo
This commit is contained in:
parent
d0b45cb696
commit
07e8e01865
@ -96,12 +96,11 @@ public class ProxyForgingTransaction extends Transaction {
|
|||||||
if (!Crypto.isValidAddress(recipient.getAddress()))
|
if (!Crypto.isValidAddress(recipient.getAddress()))
|
||||||
return ValidationResult.INVALID_ADDRESS;
|
return ValidationResult.INVALID_ADDRESS;
|
||||||
|
|
||||||
/* Not needed?
|
// If proxy public key aleady exists in repository, then it must be for the same forger-recipient combo
|
||||||
// Check recipient has known public key
|
ProxyForgerData proxyForgerData = this.repository.getAccountRepository().getProxyForgeData(this.proxyForgingTransactionData.getProxyPublicKey());
|
||||||
AccountData recipientData = this.repository.getAccountRepository().getAccount(recipient.getAddress());
|
if (proxyForgerData != null)
|
||||||
if (recipientData == null || recipientData.getPublicKey() == null)
|
if (!proxyForgerData.getRecipient().equals(recipient.getAddress()) || !Arrays.equals(proxyForgerData.getForgerPublicKey(), creator.getPublicKey()))
|
||||||
return ValidationResult.PUBLIC_KEY_UNKNOWN;
|
return ValidationResult.INVALID_PUBLIC_KEY;
|
||||||
*/
|
|
||||||
|
|
||||||
// Check fee is positive
|
// Check fee is positive
|
||||||
if (proxyForgingTransactionData.getFee().compareTo(BigDecimal.ZERO) <= 0)
|
if (proxyForgingTransactionData.getFee().compareTo(BigDecimal.ZERO) <= 0)
|
||||||
|
Loading…
Reference in New Issue
Block a user