Fixed logic bug in name registration fee calculation.

This commit is contained in:
CalDescent 2022-04-24 15:36:36 +01:00
parent 64e102a8c6
commit cca5bac30a

View File

@ -425,9 +425,8 @@ public class BlockChain {
}
public long getNameRegistrationUnitFeeAtTimestamp(long ourTimestamp) {
// Scan through for reward at our height
for (int i = 0; i < nameRegistrationUnitFees.size(); ++i)
if (ourTimestamp >= nameRegistrationUnitFees.get(i).timestamp)
for (int i = nameRegistrationUnitFees.size() - 1; i >= 0; --i)
if (nameRegistrationUnitFees.get(i).timestamp <= ourTimestamp)
return nameRegistrationUnitFees.get(i).fee;
// Default to system-wide unit fee