From dc1ede8f20ada8c381ca84702ad601f5d41c57f0 Mon Sep 17 00:00:00 2001 From: Gregory Sanders Date: Thu, 18 Apr 2019 16:03:31 -0400 Subject: [PATCH] CreateTransaction should still print blinded tx info during fundraw etc --- src/wallet/wallet.cpp | 62 +++++++++++++++++++++---------------------- 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index cae002ac94f..27ba4c93030 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -3498,6 +3498,37 @@ bool CWallet::CreateTransaction(const std::vector& vecSend, CTransac } } + // Print blinded transaction info before we possibly blow it away when !sign. + if (blind_details) { + std::string summary = "CreateTransaction created blinded transaction:\nIN: "; + for (unsigned int i = 0; i < selected_coins.size(); ++i) { + if (i > 0) { + summary += " "; + } + summary += strprintf("#%d: %s [%s] (%s [%s])\n", i, + selected_coins[i].value, + selected_coins[i].txout.nValue.IsExplicit() ? "explicit" : "blinded", + selected_coins[i].asset.GetHex(), + selected_coins[i].txout.nAsset.IsExplicit() ? "explicit" : "blinded" + ); + } + summary += "OUT: "; + for (unsigned int i = 0; i < txNew.vout.size(); ++i) { + if (i > 0) { + summary += " "; + } + CTxOut unblinded = blind_details->tx_unblinded_unsigned.vout[i]; + summary += strprintf("#%d: %s%s [%s] (%s [%s])\n", i, + txNew.vout[i].IsFee() ? "[fee] " : "", + unblinded.nValue.GetAmount(), + txNew.vout[i].nValue.IsExplicit() ? "explicit" : "blinded", + unblinded.nAsset.GetAsset().GetHex(), + txNew.vout[i].nAsset.IsExplicit() ? "explicit" : "blinded" + ); + } + WalletLogPrintf(summary+"\n"); + } + if (sign) { int nIn = 0; @@ -3536,37 +3567,6 @@ bool CWallet::CreateTransaction(const std::vector& vecSend, CTransac strFailReason = _("Transaction too large"); return false; } - - // Print unblinded transaction overview. - if (blind_details) { - std::string summary = "CreateTransaction created blinded transaction:\nIN: "; - for (unsigned int i = 0; i < selected_coins.size(); ++i) { - if (i > 0) { - summary += " "; - } - summary += strprintf("#%d: %s [%s] (%s [%s])\n", i, - selected_coins[i].value, - selected_coins[i].txout.nValue.IsExplicit() ? "explicit" : "blinded", - selected_coins[i].asset.GetHex(), - selected_coins[i].txout.nAsset.IsExplicit() ? "explicit" : "blinded" - ); - } - summary += "OUT: "; - for (unsigned int i = 0; i < tx->vout.size(); ++i) { - if (i > 0) { - summary += " "; - } - CTxOut unblinded = blind_details->tx_unblinded_unsigned.vout[i]; - summary += strprintf("#%d: %s%s [%s] (%s [%s])\n", i, - tx->vout[i].IsFee() ? "[fee] " : "", - unblinded.nValue.GetAmount(), - tx->vout[i].nValue.IsExplicit() ? "explicit" : "blinded", - unblinded.nAsset.GetAsset().GetHex(), - tx->vout[i].nAsset.IsExplicit() ? "explicit" : "blinded" - ); - } - WalletLogPrintf(summary+"\n"); - } } if (gArgs.GetBoolArg("-walletrejectlongchains", DEFAULT_WALLET_REJECT_LONG_CHAINS)) {