From 2e51538df8d5602e757c383cc7232454aee7a195 Mon Sep 17 00:00:00 2001 From: Duke Leto Date: Mon, 16 Mar 2020 07:58:12 -0400 Subject: [PATCH] Add some debug --- src/transaction_builder.cpp | 2 ++ src/wallet/asyncrpcoperation_saplingconsolidation.cpp | 3 ++- src/wallet/wallet.cpp | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/transaction_builder.cpp b/src/transaction_builder.cpp index 773792ba3..3964617ca 100644 --- a/src/transaction_builder.cpp +++ b/src/transaction_builder.cpp @@ -153,6 +153,7 @@ boost::optional TransactionBuilder::Build() // Send change to the specified change address. If no change address // was set, send change to the first Sapling address given as input. if (zChangeAddr) { + LogPrintf("%s: Adding specified Sapling change output: %s\n", __FUNCTION__, zChangeAddr->second.GetHash().ToString().c_str()); AddSaplingOutput(zChangeAddr->first, zChangeAddr->second, change); } else if (tChangeAddr) { // tChangeAddr has already been validated. @@ -162,6 +163,7 @@ boost::optional TransactionBuilder::Build() auto note = spends[0].note; libzcash::SaplingPaymentAddress changeAddr(note.d, note.pk_d); AddSaplingOutput(fvk.ovk, changeAddr, change); + LogPrintf("%s: Adding Sapling change output from first zinput: %s\n", __FUNCTION__, changeAddr.GetHash().ToString().c_str() ); } else { return boost::none; } diff --git a/src/wallet/asyncrpcoperation_saplingconsolidation.cpp b/src/wallet/asyncrpcoperation_saplingconsolidation.cpp index 47570aca3..af15b5b76 100644 --- a/src/wallet/asyncrpcoperation_saplingconsolidation.cpp +++ b/src/wallet/asyncrpcoperation_saplingconsolidation.cpp @@ -189,7 +189,7 @@ bool AsyncRPCOperation_saplingconsolidation::main_impl() { for(size_t i = 0; i < MIN_ZOUTS; i++) { // In Privacy Zdust We Trust -- Duke string zdust = randomSietchZaddr(); - auto zaddr = DecodePaymentAddress(zdust); + auto zaddr = DecodePaymentAddress(zdust); if (IsValidPaymentAddress(zaddr)) { auto sietchZoutput = boost::get(zaddr); LogPrint("zrpcunsafe", "%s: Adding sietch output %s", getId(), sietchZoutput.GetHash().ToString().c_str() ); @@ -200,6 +200,7 @@ bool AsyncRPCOperation_saplingconsolidation::main_impl() { break; } } + LogPrint("zrpcunsafe", "%s: Done adding sietch zouts", getId()); //CTransaction tx = builder.Build(); auto maybe_tx = builder.Build(); diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index 20e137dc7..22d193a8c 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -640,6 +640,7 @@ void CWallet::RunSaplingConsolidation(int blockHeight) { bool CWallet::CommitConsolidationTx(const CTransaction& tx) { CWalletTx wtx(this, tx); CReserveKey reservekey(pwalletMain); + fprintf(stderr,"%s: %s\n",__func__,tx.ToString().c_str()); return CommitTransaction(wtx, reservekey); }