This actually has pretty decent logging for when nullifiers are added

This commit is contained in:
Duke Leto
2019-12-30 07:14:46 -05:00
parent c7d391176d
commit ace213c54f
3 changed files with 11 additions and 1 deletions

View File

@@ -1,6 +1,6 @@
// Copyright (c) 2010 Satoshi Nakamoto
// Copyright (c) 2009-2015 The Bitcoin Core developers
// Copyright (c) 2019 The Hush developers
// Copyright (c) 2019-2020 The Hush developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
@@ -1377,6 +1377,7 @@ UniValue sendrawtransaction(const UniValue& params, bool fHelp, const CPubKey& m
// push to local node and sync with wallets
CValidationState state;
bool fMissingInputs;
LogPrintf("%s: Submitting to mempool\n", __FUNCTION__);
if (!AcceptToMemoryPool(mempool, state, tx, false, &fMissingInputs, !fOverrideFees)) {
if (state.IsInvalid()) {
throw JSONRPCError(RPC_TRANSACTION_REJECTED, strprintf("%i: %s", state.GetRejectCode(), state.GetRejectReason()));
@@ -1390,6 +1391,7 @@ UniValue sendrawtransaction(const UniValue& params, bool fHelp, const CPubKey& m
} else if (fHaveChain) {
throw JSONRPCError(RPC_TRANSACTION_ALREADY_IN_CHAIN, "transaction already in block chain");
}
LogPrintf("%s: Relaying raw tx to mempool\n", __FUNCTION__);
RelayTransaction(tx);
}
else

View File

@@ -1,4 +1,7 @@
// Copyright (c) 2018 The Zcash developers
// Copyright (c) 2019-2020 The Hush developers
// Released under the GPLv3
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
@@ -9,6 +12,7 @@
#include "script/sign.h"
#include <boost/variant.hpp>
#include <boost/optional/optional_io.hpp>
#include <librustzcash.h>
SpendDescriptionInfo::SpendDescriptionInfo(
@@ -169,6 +173,7 @@ boost::optional<CTransaction> TransactionBuilder::Build()
auto ctx = librustzcash_sapling_proving_ctx_init();
LogPrintf("%s: Creating Sapling SpendDescriptions\n", __FUNCTION__);
// Create Sapling SpendDescriptions
for (auto spend : spends) {
auto cm = spend.note.cm();
@@ -203,6 +208,7 @@ boost::optional<CTransaction> TransactionBuilder::Build()
sdesc.anchor = spend.anchor;
sdesc.nullifier = *nf;
LogPrintf("%s: Created cm + nullifier=%s\n", __FUNCTION__, sdesc.nullifier.ToString().c_str() );
mtx.vShieldedSpend.push_back(sdesc);
}

View File

@@ -50,6 +50,7 @@
#include <string>
#include "paymentdisclosuredb.h"
#include <boost/optional/optional_io.hpp>
using namespace libzcash;
@@ -504,6 +505,7 @@ bool AsyncRPCOperation_sendmany::main_impl() {
auto addr = DecodePaymentAddress(address);
assert(boost::get<libzcash::SaplingPaymentAddress>(&addr) != nullptr);
auto to = boost::get<libzcash::SaplingPaymentAddress>(addr);
LogPrintf("%s: Adding Sapling output to address %s\n", __FUNCTION__, to.GetHash().ToString().c_str());
auto memo = get_memo_from_hex_string(hexMemo);