From 4800f497aa9d7f6a496985ecf4756f0c354bd040 Mon Sep 17 00:00:00 2001 From: Duke Leto Date: Wed, 17 Jun 2020 22:32:00 -0400 Subject: [PATCH] Fix copyright --- src/wallet/asyncrpcoperation_saplingconsolidation.cpp | 11 +++++++++-- src/wallet/asyncrpcoperation_saplingconsolidation.h | 2 +- src/wallet/wallet.cpp | 3 +-- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/wallet/asyncrpcoperation_saplingconsolidation.cpp b/src/wallet/asyncrpcoperation_saplingconsolidation.cpp index 477545348..0c6cae7c1 100644 --- a/src/wallet/asyncrpcoperation_saplingconsolidation.cpp +++ b/src/wallet/asyncrpcoperation_saplingconsolidation.cpp @@ -95,15 +95,22 @@ bool AsyncRPCOperation_saplingconsolidation::main_impl() { // an anchor at height N-10 for each SpendDescription // Consider, should notes be sorted? pwalletMain->GetFilteredNotes(saplingEntries, "", 11); + + if(saplingEntries.size() == 0) { + LogPrint("zrpcunsafe", "%s: Nothing to consolidate, done.\n",opid); + return true; + } + if (fConsolidationMapUsed) { const vector& v = mapMultiArgs["-consolidatesaplingaddress"]; for(int i = 0; i < v.size(); i++) { auto zAddress = DecodePaymentAddress(v[i]); if (boost::get(&zAddress) != nullptr) { libzcash::SaplingPaymentAddress saplingAddress = boost::get(zAddress); - addresses.insert(saplingAddress ); + addresses.insert(saplingAddress); } else { - //TODO: how to handle invalid zaddrs? + LogPrint("zrpcunsafe", "%s: Invalid zaddr, exiting\n", opid); + return false; } } } else { diff --git a/src/wallet/asyncrpcoperation_saplingconsolidation.h b/src/wallet/asyncrpcoperation_saplingconsolidation.h index 9a80ff7c7..5d14b9335 100644 --- a/src/wallet/asyncrpcoperation_saplingconsolidation.h +++ b/src/wallet/asyncrpcoperation_saplingconsolidation.h @@ -1,5 +1,5 @@ // Copyright (c) 2020 The Hush developers -// TODO: Forge should add his preferred copyright line here +// Copyright (c) 2019 CryptoForge // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index b3d759f83..c0f449a56 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -1733,8 +1733,7 @@ void CWallet::GetSaplingNoteWitnesses(std::vector notes, //fprintf(stderr,"%s: rt=%s\n",__func__,rt.GetHash().ToString().c_str()); //fprintf(stderr,"%s: witnesses[%d]->root()=%s\n",__func__,i,witnesses[i]->root().GetHash().ToString().c_str()); // Something is fucky - std::string err = "CWallet::GetSaplingNoteWitnesses: Invalid witness root! i="; - err += i; + std::string err = "CWallet::GetSaplingNoteWitnesses: Invalid witness root!"; throw std::logic_error(err); }