Closed GalRogozinski closed 4 years ago
@acha-bill
Taking a discussion from slack here about the behavior of GetBalances
.
I think this doesn't hurt previously confirmed txs because the snapshot is being inspected directly here:
for (final Hash address : addressList) {
Long value = snapshotProvider.getLatestSnapshot().getBalance(address);
if (value == null) {
value = 0L;
}
balances.put(address, value);
}
Description
We want the rules added in #1786 to only be used when we are doing tip-selection and check consistency calls. This is so that IRI won't give an error when calculating the ledger state on old milestones that didn't adhere to the rule.
We have a boolean flag in the
validate
method that takes care of the 2 modes, that forces the extra checks.Fixes #1746
Type of change
How Has This Been Tested?
Unit test have been added
true
, on a bundle that will otherwise be valid.false
we verify that the extra checks are not being calledChecklist: