From 01f6c5dbee57913314a89914e9c714b14fc9546c Mon Sep 17 00:00:00 2001 From: Simon Date: Tue, 3 Jan 2017 23:57:11 -0800 Subject: [PATCH] Fixes #1967 by adding age of note to z_sendmany logging. --- src/wallet/asyncrpcoperation_sendmany.cpp | 29 +++++++++++++++++++---- 1 file changed, 24 insertions(+), 5 deletions(-) diff --git a/src/wallet/asyncrpcoperation_sendmany.cpp b/src/wallet/asyncrpcoperation_sendmany.cpp index c65664eae..a4d32361a 100644 --- a/src/wallet/asyncrpcoperation_sendmany.cpp +++ b/src/wallet/asyncrpcoperation_sendmany.cpp @@ -448,13 +448,22 @@ bool AsyncRPCOperation_sendmany::main_impl() { info.notes.push_back(note); outPoints.push_back(outPoint); - - LogPrint("zrpc", "%s: spending note (txid=%s, vjoinsplit=%d, ciphertext=%d, amount=%s)\n", + int wtxHeight = -1; + int wtxDepth = -1; + { + LOCK2(cs_main, pwalletMain->cs_wallet); + const CWalletTx& wtx = pwalletMain->mapWallet[outPoint.hash]; + wtxHeight = mapBlockIndex[wtx.hashBlock]->nHeight; + wtxDepth = wtx.GetDepthInMainChain(); + } + LogPrint("zrpc", "%s: spending note (txid=%s, vjoinsplit=%d, ciphertext=%d, amount=%s, height=%d, confirmations=%d)\n", getId().substr(0, 10), outPoint.hash.ToString().substr(0, 10), outPoint.js, int(outPoint.n), // uint8_t - FormatMoney(noteFunds, false) + FormatMoney(noteFunds, false), + wtxHeight, + wtxDepth ); @@ -611,12 +620,22 @@ bool AsyncRPCOperation_sendmany::main_impl() { jsInputValue += noteFunds; - LogPrint("zrpc", "%s: spending note (txid=%s, vjoinsplit=%d, ciphertext=%d, amount=%s)\n", + int wtxHeight = -1; + int wtxDepth = -1; + { + LOCK2(cs_main, pwalletMain->cs_wallet); + const CWalletTx& wtx = pwalletMain->mapWallet[jso.hash]; + wtxHeight = mapBlockIndex[wtx.hashBlock]->nHeight; + wtxDepth = wtx.GetDepthInMainChain(); + } + LogPrint("zrpc", "%s: spending note (txid=%s, vjoinsplit=%d, ciphertext=%d, amount=%s, height=%d, confirmations=%d)\n", getId().substr(0, 10), jso.hash.ToString().substr(0, 10), jso.js, int(jso.n), // uint8_t - FormatMoney(noteFunds, false) + FormatMoney(noteFunds, false), + wtxHeight, + wtxDepth ); }