From 446f867b4c0c714d7041a2ebb55b0baff4641f6e Mon Sep 17 00:00:00 2001 From: Simon Date: Thu, 20 Oct 2016 15:23:34 -0700 Subject: [PATCH] Add debug option "zrpcunsafe" to be used when logging more sensitive information such as the memo field of a note. --- src/wallet/asyncrpcoperation_sendmany.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/wallet/asyncrpcoperation_sendmany.cpp b/src/wallet/asyncrpcoperation_sendmany.cpp index d6f41219..eaa24585 100644 --- a/src/wallet/asyncrpcoperation_sendmany.cpp +++ b/src/wallet/asyncrpcoperation_sendmany.cpp @@ -780,7 +780,8 @@ bool AsyncRPCOperation_sendmany::find_unspent_notes() { for (CNotePlaintextEntry & entry : entries) { z_inputs_.push_back(SendManyInputJSOP(entry.jsop, entry.plaintext.note(frompaymentaddress_), CAmount(entry.plaintext.value))); std::string data(entry.plaintext.memo.begin(), entry.plaintext.memo.end()); - LogPrint("zrpc", "%s: found unspent note (txid=%s, vjoinsplit=%d, ciphertext=%d, amount=%s, memo=%s)\n", + if (LogAcceptCategory("zrpcunsafe")) { + LogPrint("zrpcunsafe", "%s: found unspent note (txid=%s, vjoinsplit=%d, ciphertext=%d, amount=%s, memo=%s)\n", getId().substr(0, 10), entry.jsop.hash.ToString().substr(0, 10), entry.jsop.js, @@ -788,6 +789,15 @@ bool AsyncRPCOperation_sendmany::find_unspent_notes() { FormatMoney(entry.plaintext.value, false), HexStr(data).substr(0, 10) ); + } else { + LogPrint("zrpc", "%s: found unspent note (txid=%s, vjoinsplit=%d, ciphertext=%d, amount=%s)\n", + getId().substr(0, 10), + entry.jsop.hash.ToString().substr(0, 10), + entry.jsop.js, + int(entry.jsop.n), // uint8_t + FormatMoney(entry.plaintext.value, false) + ); + } } if (z_inputs_.size() == 0) {