diff options
author | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2016-06-12 22:41:40 +0100 |
---|---|---|
committer | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2016-08-28 21:28:25 +0100 |
commit | e99904ac310d0c603dae18b8a9ad3d93bff8e249 (patch) | |
tree | 15fa63da0d25d641c5a95349ef192368861f2e48 /src/ringct | |
parent | ringct: txn fee stuff (diff) | |
download | monero-e99904ac310d0c603dae18b8a9ad3d93bff8e249.tar.xz |
ringct: make fee optional
Diffstat (limited to '')
-rw-r--r-- | src/ringct/rctSigs.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/ringct/rctSigs.cpp b/src/ringct/rctSigs.cpp index 53cb1ab6f..a07dbaab3 100644 --- a/src/ringct/rctSigs.cpp +++ b/src/ringct/rctSigs.cpp @@ -472,7 +472,7 @@ namespace rct { // Thus the amounts vector will be "one" longer than the destinations vectort rctSig genRct(const ctkeyV & inSk, const keyV & destinations, const vector<xmr_amount> amounts, const ctkeyM &mixRing, unsigned int index) { CHECK_AND_ASSERT_THROW_MES(amounts.size() > 0, "Amounts must not be empty"); - CHECK_AND_ASSERT_THROW_MES(amounts.size() == destinations.size(), "Different number of amounts/destinations"); + CHECK_AND_ASSERT_THROW_MES(amounts.size() == destinations.size() || amounts.size() == destinations.size() + 1, "Different number of amounts/destinations"); CHECK_AND_ASSERT_THROW_MES(index < mixRing.size(), "Bad index into mixRing"); for (size_t n = 0; n < mixRing.size(); ++n) { CHECK_AND_ASSERT_THROW_MES(mixRing[n].size() == inSk.size(), "Bad mixRing size"); @@ -503,7 +503,14 @@ namespace rct { } //set txn fee - rv.txnFee = amounts[destinations.size()]; + if (amounts.size() > destinations.size()) + { + rv.txnFee = amounts[destinations.size()]; + } + else + { + rv.txnFee = 0; + } key txnFeeKey = scalarmultH(d2h(rv.txnFee)); rv.mixRing = mixRing; |