forked from lthn/blockchain
Compare commits
2 commits
dev
...
ionic_debu
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fb1038cd08 | ||
|
|
ad2067cb3f |
3 changed files with 12 additions and 4 deletions
|
|
@ -36,7 +36,8 @@ using namespace epee;
|
||||||
#include "wallet/wallet_debug_events_definitions.h"
|
#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
|
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::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;
|
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(bare_inputs_sum);
|
||||||
DBG_VAL_PRINT(fee);
|
DBG_VAL_PRINT(fee);
|
||||||
DBG_VAL_PRINT(ogc.pseudo_out_amount_commitments_sum);
|
DBG_VAL_PRINT(ogc.pseudo_out_amount_commitments_sum);
|
||||||
|
|
@ -323,10 +325,10 @@ namespace currency
|
||||||
DBG_VAL_PRINT(commitment_to_zero);
|
DBG_VAL_PRINT(commitment_to_zero);
|
||||||
DBG_VAL_PRINT(secret_x);
|
DBG_VAL_PRINT(secret_x);
|
||||||
|
|
||||||
#ifndef NDEBUG
|
//#ifndef NDEBUG
|
||||||
bool commitment_to_zero_is_sane = commitment_to_zero == secret_x * crypto::c_point_X;
|
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)");
|
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);
|
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");
|
CHECK_AND_ASSERT_MES(r, false, "generate_schnorr_sig (X) failed");
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,6 @@
|
||||||
#define PROJECT_REVISION "0"
|
#define PROJECT_REVISION "0"
|
||||||
#define PROJECT_VERSION PROJECT_MAJOR_VERSION "." PROJECT_MINOR_VERSION "." PROJECT_REVISION
|
#define PROJECT_VERSION PROJECT_MAJOR_VERSION "." PROJECT_MINOR_VERSION "." PROJECT_REVISION
|
||||||
|
|
||||||
#define PROJECT_VERSION_BUILD_NO 234
|
#define PROJECT_VERSION_BUILD_NO 235
|
||||||
#define PROJECT_VERSION_BUILD_NO_STR STRINGIFY_EXPAND(PROJECT_VERSION_BUILD_NO)
|
#define PROJECT_VERSION_BUILD_NO_STR STRINGIFY_EXPAND(PROJECT_VERSION_BUILD_NO)
|
||||||
#define PROJECT_VERSION_LONG PROJECT_VERSION "." PROJECT_VERSION_BUILD_NO_STR "[" BUILD_COMMIT_ID "]"
|
#define PROJECT_VERSION_LONG PROJECT_VERSION "." PROJECT_VERSION_BUILD_NO_STR "[" BUILD_COMMIT_ID "]"
|
||||||
|
|
|
||||||
|
|
@ -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
|
// 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");
|
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);
|
//TIME_MEASURE_START_MS(construct_tx_time);
|
||||||
bool r = currency::construct_tx(m_account.get_keys(),
|
bool r = currency::construct_tx(m_account.get_keys(),
|
||||||
ftp, result);
|
ftp, result);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue