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

@@ -98,14 +98,14 @@ CWalletTx GetValidSpend(ZCJoinSplit& params,
libzcash::JSInput dummyin;
{
if (note.value > value) {
if (note.value() > value) {
libzcash::SpendingKey dummykey = libzcash::SpendingKey::random();
libzcash::PaymentAddress dummyaddr = dummykey.address();
dummyout = libzcash::JSOutput(dummyaddr, note.value - value);
} else if (note.value < value) {
dummyout = libzcash::JSOutput(dummyaddr, note.value() - value);
} else if (note.value() < value) {
libzcash::SpendingKey dummykey = libzcash::SpendingKey::random();
libzcash::PaymentAddress dummyaddr = dummykey.address();
libzcash::SproutNote dummynote(dummyaddr.a_pk, (value - note.value), uint256(), uint256());
libzcash::SproutNote dummynote(dummyaddr.a_pk, (value - note.value()), uint256(), uint256());
tree.append(dummynote.cm());
dummyin = libzcash::JSInput(tree.witness(), dummynote, dummykey);
}