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

@@ -13,7 +13,6 @@ SproutNote::SproutNote() {
a_pk = random_uint256();
rho = random_uint256();
r = random_uint256();
value = 0;
}
uint256 SproutNote::cm() const {
@@ -23,7 +22,7 @@ uint256 SproutNote::cm() const {
hasher.Write(&discriminant, 1);
hasher.Write(a_pk.begin(), 32);
auto value_vec = convertIntToVectorLE(value);
auto value_vec = convertIntToVectorLE(value_);
hasher.Write(&value_vec[0], value_vec.size());
hasher.Write(rho.begin(), 32);
@@ -43,7 +42,7 @@ NotePlaintext::NotePlaintext(
const SproutNote& note,
boost::array<unsigned char, ZC_MEMO_SIZE> memo) : memo(memo)
{
value = note.value;
value = note.value();
rho = note.rho;
r = note.r;
}