Use a zero fee for ARBITRARY transactions, as we require a PoW nonce instead.

This commit is contained in:
CalDescent 2021-12-01 18:12:33 +00:00
parent ed2d1c4932
commit 8525fb89f8
2 changed files with 9 additions and 1 deletions

View File

@ -217,7 +217,7 @@ public class ArbitraryDataTransactionBuilder {
}
final BaseTransactionData baseTransactionData = new BaseTransactionData(now, Group.NO_GROUP,
lastReference, creatorPublicKey, BlockChain.getInstance().getUnitFee(), null);
lastReference, creatorPublicKey, 0L, null);
final int size = (int) arbitraryDataFile.size();
final int version = 5;
final int nonce = 0;

View File

@ -73,6 +73,14 @@ public class ArbitraryTransaction extends Transaction {
this.arbitraryTransactionData.setNonce(MemoryPoW.compute2(transactionBytes, POW_BUFFER_SIZE, POW_DIFFICULTY));
}
@Override
public ValidationResult isFeeValid() throws DataException {
if (this.transactionData.getFee() < 0)
return ValidationResult.NEGATIVE_FEE;
return ValidationResult.OK;
}
@Override
public boolean hasValidReference() throws DataException {
// We shouldn't really get this far, but just in case: