mirror of
https://github.com/Qortal/altcoinj.git
synced 2025-02-12 18:25:51 +00:00
Access NetworkParameters.MAX_MONEY in a static way.
This commit is contained in:
parent
39586bf515
commit
346e8fb3bf
@ -223,12 +223,12 @@ public class FullPrunedBlockChain extends AbstractBlockChain {
|
|||||||
}
|
}
|
||||||
// All values were already checked for being non-negative (as it is verified in Transaction.verify())
|
// All values were already checked for being non-negative (as it is verified in Transaction.verify())
|
||||||
// but we check again here just for defence in depth. Transactions with zero output value are OK.
|
// but we check again here just for defence in depth. Transactions with zero output value are OK.
|
||||||
if (valueOut.signum() < 0 || valueOut.compareTo(params.MAX_MONEY) > 0)
|
if (valueOut.signum() < 0 || valueOut.compareTo(NetworkParameters.MAX_MONEY) > 0)
|
||||||
throw new VerificationException("Transaction output value out of rage");
|
throw new VerificationException("Transaction output value out of rage");
|
||||||
if (isCoinBase) {
|
if (isCoinBase) {
|
||||||
coinbaseValue = valueOut;
|
coinbaseValue = valueOut;
|
||||||
} else {
|
} else {
|
||||||
if (valueIn.compareTo(valueOut) < 0 || valueIn.compareTo(params.MAX_MONEY) > 0)
|
if (valueIn.compareTo(valueOut) < 0 || valueIn.compareTo(NetworkParameters.MAX_MONEY) > 0)
|
||||||
throw new VerificationException("Transaction input value out of range");
|
throw new VerificationException("Transaction input value out of range");
|
||||||
totalFees = totalFees.add(valueIn.subtract(valueOut));
|
totalFees = totalFees.add(valueIn.subtract(valueOut));
|
||||||
}
|
}
|
||||||
@ -240,7 +240,7 @@ public class FullPrunedBlockChain extends AbstractBlockChain {
|
|||||||
listScriptVerificationResults.add(future);
|
listScriptVerificationResults.add(future);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (totalFees.compareTo(params.MAX_MONEY) > 0 || block.getBlockInflation(height).add(totalFees).compareTo(coinbaseValue) < 0)
|
if (totalFees.compareTo(NetworkParameters.MAX_MONEY) > 0 || block.getBlockInflation(height).add(totalFees).compareTo(coinbaseValue) < 0)
|
||||||
throw new VerificationException("Transaction fees out of range");
|
throw new VerificationException("Transaction fees out of range");
|
||||||
for (Future<VerificationException> future : listScriptVerificationResults) {
|
for (Future<VerificationException> future : listScriptVerificationResults) {
|
||||||
VerificationException e;
|
VerificationException e;
|
||||||
@ -345,12 +345,12 @@ public class FullPrunedBlockChain extends AbstractBlockChain {
|
|||||||
}
|
}
|
||||||
// All values were already checked for being non-negative (as it is verified in Transaction.verify())
|
// All values were already checked for being non-negative (as it is verified in Transaction.verify())
|
||||||
// but we check again here just for defence in depth. Transactions with zero output value are OK.
|
// but we check again here just for defence in depth. Transactions with zero output value are OK.
|
||||||
if (valueOut.signum() < 0 || valueOut.compareTo(params.MAX_MONEY) > 0)
|
if (valueOut.signum() < 0 || valueOut.compareTo(NetworkParameters.MAX_MONEY) > 0)
|
||||||
throw new VerificationException("Transaction output value out of rage");
|
throw new VerificationException("Transaction output value out of rage");
|
||||||
if (isCoinBase) {
|
if (isCoinBase) {
|
||||||
coinbaseValue = valueOut;
|
coinbaseValue = valueOut;
|
||||||
} else {
|
} else {
|
||||||
if (valueIn.compareTo(valueOut) < 0 || valueIn.compareTo(params.MAX_MONEY) > 0)
|
if (valueIn.compareTo(valueOut) < 0 || valueIn.compareTo(NetworkParameters.MAX_MONEY) > 0)
|
||||||
throw new VerificationException("Transaction input value out of range");
|
throw new VerificationException("Transaction input value out of range");
|
||||||
totalFees = totalFees.add(valueIn.subtract(valueOut));
|
totalFees = totalFees.add(valueIn.subtract(valueOut));
|
||||||
}
|
}
|
||||||
@ -362,7 +362,7 @@ public class FullPrunedBlockChain extends AbstractBlockChain {
|
|||||||
listScriptVerificationResults.add(future);
|
listScriptVerificationResults.add(future);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (totalFees.compareTo(params.MAX_MONEY) > 0 ||
|
if (totalFees.compareTo(NetworkParameters.MAX_MONEY) > 0 ||
|
||||||
newBlock.getHeader().getBlockInflation(newBlock.getHeight()).add(totalFees).compareTo(coinbaseValue) < 0)
|
newBlock.getHeader().getBlockInflation(newBlock.getHeight()).add(totalFees).compareTo(coinbaseValue) < 0)
|
||||||
throw new VerificationException("Transaction fees out of range");
|
throw new VerificationException("Transaction fees out of range");
|
||||||
txOutChanges = new TransactionOutputChanges(txOutsCreated, txOutsSpent);
|
txOutChanges = new TransactionOutputChanges(txOutsCreated, txOutsSpent);
|
||||||
|
@ -1273,7 +1273,7 @@ public class Transaction extends ChildMessage implements Serializable {
|
|||||||
throw new VerificationException("Transaction output negative");
|
throw new VerificationException("Transaction output negative");
|
||||||
valueOut = valueOut.add(output.getValue());
|
valueOut = valueOut.add(output.getValue());
|
||||||
}
|
}
|
||||||
if (valueOut.compareTo(params.MAX_MONEY) > 0)
|
if (valueOut.compareTo(NetworkParameters.MAX_MONEY) > 0)
|
||||||
throw new VerificationException("Total transaction output value greater than possible");
|
throw new VerificationException("Total transaction output value greater than possible");
|
||||||
|
|
||||||
if (isCoinBase()) {
|
if (isCoinBase()) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user