forked from lthn/blockchain
temporary debug logging
This commit is contained in:
parent
e066257278
commit
ad2067cb3f
2 changed files with 11 additions and 3 deletions
|
|
@ -36,7 +36,8 @@ using namespace epee;
|
|||
#include "wallet/wallet_debug_events_definitions.h"
|
||||
|
||||
|
||||
#define DBG_VAL_PRINT(x) ((void)0) // LOG_PRINT_CYAN(std::setw(42) << std::left << #x ":" << x, LOG_LEVEL_0)
|
||||
//#define DBG_VAL_PRINT(x) ((void)0)
|
||||
#define DBG_VAL_PRINT(x) LOG_PRINT_CYAN(std::setw(42) << std::left << #x ":" << x, LOG_LEVEL_0)
|
||||
|
||||
namespace currency
|
||||
{
|
||||
|
|
@ -312,6 +313,7 @@ namespace currency
|
|||
crypto::point_t commitment_to_zero = (crypto::scalar_t(bare_inputs_sum) - crypto::scalar_t(fee)) * currency::native_coin_asset_id_pt + ogc.pseudo_out_amount_commitments_sum + (ogc.ao_commitment_in_outputs ? -ogc.ao_amount_commitment : ogc.ao_amount_commitment) - ogc.amount_commitments_sum;
|
||||
crypto::scalar_t secret_x = ogc.real_in_asset_id_blinding_mask_x_amount_sum - ogc.asset_id_blinding_mask_x_amount_sum;
|
||||
|
||||
DBG_VAL_PRINT("==generate_tx_balance_proof (X)==");
|
||||
DBG_VAL_PRINT(bare_inputs_sum);
|
||||
DBG_VAL_PRINT(fee);
|
||||
DBG_VAL_PRINT(ogc.pseudo_out_amount_commitments_sum);
|
||||
|
|
@ -323,10 +325,10 @@ namespace currency
|
|||
DBG_VAL_PRINT(commitment_to_zero);
|
||||
DBG_VAL_PRINT(secret_x);
|
||||
|
||||
#ifndef NDEBUG
|
||||
//#ifndef NDEBUG
|
||||
bool commitment_to_zero_is_sane = commitment_to_zero == secret_x * crypto::c_point_X;
|
||||
CHECK_AND_ASSERT_MES(commitment_to_zero_is_sane, false, "internal error: commitment_to_zero is malformed (X)");
|
||||
#endif
|
||||
//#endif
|
||||
r = crypto::generate_schnorr_sig<crypto::gt_X>(tx_id, commitment_to_zero, secret_x, proof.ss);
|
||||
CHECK_AND_ASSERT_MES(r, false, "generate_schnorr_sig (X) failed");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6814,6 +6814,12 @@ void wallet2::finalize_transaction(const currency::finalize_tx_param& ftp, curre
|
|||
// broadcasting tx without secret key storing is forbidden to avoid lost key issues
|
||||
WLT_THROW_IF_FALSE_WALLET_INT_ERR_EX(!broadcast_tx || store_tx_secret_key, "finalize_tx is requested to broadcast a tx without storing the key");
|
||||
|
||||
std::string filename = std::string("ftp_") + epee::string_tools::int_to_hex(crypto::rand<uint64_t>()).substr(2);
|
||||
std::string ftp_serialized;
|
||||
WLT_THROW_IF_FALSE_WALLET_INT_ERR_EX(t_serializable_object_to_blob(ftp, ftp_serialized), "t_serializable_object_to_blob(ftp) failed");
|
||||
epee::file_io_utils::save_string_to_file_throw(filename, ftp_serialized);
|
||||
LOG_PRINT_L0("finalize tx params were serialized to: " << filename);
|
||||
|
||||
//TIME_MEASURE_START_MS(construct_tx_time);
|
||||
bool r = currency::construct_tx(m_account.get_keys(),
|
||||
ftp, result);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue