Refactoring: SproutNote member variable value moved to BaseNote.

All notes have a value, so the member variable has been moved to the
base class, and direct member access has been replaced with a getter.
This commit is contained in:
Simon
2018-04-25 13:32:13 -07:00
parent b230fe6836
commit 5d99e3e92f
11 changed files with 24 additions and 21 deletions

View File

@@ -168,7 +168,7 @@ public:
// Sanity checks of input
{
// If note has nonzero value
if (inputs[i].note.value != 0) {
if (inputs[i].note.value() != 0) {
// The witness root must equal the input root.
if (inputs[i].witness.root() != rt) {
throw std::invalid_argument("joinsplit not anchored to the correct root");
@@ -186,11 +186,11 @@ public:
}
// Balance must be sensical
if (inputs[i].note.value > MAX_MONEY) {
if (inputs[i].note.value() > MAX_MONEY) {
throw std::invalid_argument("nonsensical input note value");
}
lhs_value += inputs[i].note.value;
lhs_value += inputs[i].note.value();
if (lhs_value > MAX_MONEY) {
throw std::invalid_argument("nonsensical left hand size of joinsplit balance");