diff --git a/src/cryptonote_basic/cryptonote_basic_impl.cpp b/src/cryptonote_basic/cryptonote_basic_impl.cpp index b215c8252..b52aa59a5 100644 --- a/src/cryptonote_basic/cryptonote_basic_impl.cpp +++ b/src/cryptonote_basic/cryptonote_basic_impl.cpp @@ -82,7 +82,7 @@ namespace cryptonote { //----------------------------------------------------------------------------------------------- bool get_block_reward(size_t median_weight, size_t current_block_weight, uint64_t already_generated_coins, uint64_t &reward, uint8_t version) { static_assert(DIFFICULTY_TARGET_V2%60==0&&DIFFICULTY_TARGET_V1%60==0,"difficulty targets must be a multiple of 60"); - const int target = version < 2 ? DIFFICULTY_TARGET_V1 : DIFFICULTY_TARGET_V2; + const int target = DIFFICULTY_TARGET_V2; const int target_minutes = target / 60; const int emission_speed_factor = EMISSION_SPEED_FACTOR_PER_MINUTE - (target_minutes-1); diff --git a/src/cryptonote_config.h b/src/cryptonote_config.h index 418a43d41..9b1e610ea 100644 --- a/src/cryptonote_config.h +++ b/src/cryptonote_config.h @@ -52,7 +52,7 @@ // MONEY_SUPPLY - total number coins to be generated #define MONEY_SUPPLY ((uint64_t)(18440000000000000ull)) // 184.4M coins * pow(10, 8) -#define EMISSION_SPEED_FACTOR_PER_MINUTE (20) +#define EMISSION_SPEED_FACTOR_PER_MINUTE (21) #define FINAL_SUBSIDY_PER_MINUTE ((uint64_t)30000000) // 3 * pow(10, 7) #define BURN_LOCK_PERIOD 0 @@ -216,7 +216,7 @@ #define HF_VERSION_ENABLE_ORACLE 2 #define HF_VERSION_SLIPPAGE_YIELD 2 -#define TESTNET_VERSION 10 +#define TESTNET_VERSION 11 #define STAGENET_VERSION 1 #define PER_KB_FEE_QUANTIZATION_DECIMALS 8 diff --git a/src/cryptonote_core/blockchain.cpp b/src/cryptonote_core/blockchain.cpp index 134543fc9..03ff8c9d9 100644 --- a/src/cryptonote_core/blockchain.cpp +++ b/src/cryptonote_core/blockchain.cpp @@ -1044,7 +1044,7 @@ size_t Blockchain::recalculate_difficulties(boost::optional start_heig std::vector new_cumulative_difficulties; for (uint64_t height = start_height; height <= top_height; ++height) { - size_t target = get_ideal_hard_fork_version(height) < 2 ? DIFFICULTY_TARGET_V1 : DIFFICULTY_TARGET_V2; + size_t target = DIFFICULTY_TARGET_V2; difficulty_type recalculated_diff = next_difficulty(timestamps, difficulties, target); boost::multiprecision::uint256_t recalculated_cum_diff_256 = boost::multiprecision::uint256_t(recalculated_diff) + last_cum_diff; @@ -1351,7 +1351,7 @@ difficulty_type Blockchain::get_next_difficulty_for_alternative_chain(const std: } // FIXME: This will fail if fork activation heights are subject to voting - size_t target = get_ideal_hard_fork_version(bei.height) < 2 ? DIFFICULTY_TARGET_V1 : DIFFICULTY_TARGET_V2; + size_t target = DIFFICULTY_TARGET_V2; // calculate the difficulty target for the block and return it return next_difficulty(timestamps, cumulative_difficulties, target); @@ -5978,7 +5978,7 @@ bool Blockchain::get_hard_fork_voting_info(uint8_t version, uint32_t &window, ui uint64_t Blockchain::get_difficulty_target() const { - return get_current_hard_fork_version() < 2 ? DIFFICULTY_TARGET_V1 : DIFFICULTY_TARGET_V2; + return DIFFICULTY_TARGET_V2; } std::map> Blockchain:: get_output_histogram(const std::vector &amounts, bool unlocked, uint64_t recent_cutoff, uint64_t min_count) const diff --git a/src/cryptonote_core/tx_pool.cpp b/src/cryptonote_core/tx_pool.cpp index 554d432ce..707d870a6 100644 --- a/src/cryptonote_core/tx_pool.cpp +++ b/src/cryptonote_core/tx_pool.cpp @@ -260,6 +260,13 @@ namespace cryptonote return false; } + // Check the TX type + if (tx.type <= cryptonote::transaction_type::UNSET || tx.type > cryptonote::transaction_type::MAX) { + LOG_PRINT_L1("Transaction with id= "<< id << " has invalid type " << (uint8_t)tx.type); + tvc.m_verifivation_failed = true; + return false; + } + // assume failure during verification steps until success is certain tvc.m_verifivation_failed = true; diff --git a/src/cryptonote_protocol/enums.h b/src/cryptonote_protocol/enums.h index 7a9fbf96e..8534682fb 100644 --- a/src/cryptonote_protocol/enums.h +++ b/src/cryptonote_protocol/enums.h @@ -52,6 +52,7 @@ namespace cryptonote CONVERT = 4, BURN = 5, STAKE = 6, - RETURN = 7 + RETURN = 7, + MAX = 7 }; } diff --git a/src/simplewallet/simplewallet.cpp b/src/simplewallet/simplewallet.cpp index 38b72c0b5..1a76f17ae 100644 --- a/src/simplewallet/simplewallet.cpp +++ b/src/simplewallet/simplewallet.cpp @@ -239,7 +239,7 @@ namespace const char* USAGE_CHECK_SPEND_PROOF("check_spend_proof []"); const char* USAGE_GET_RESERVE_PROOF("get_reserve_proof (all|) []"); const char* USAGE_CHECK_RESERVE_PROOF("check_reserve_proof
[]"); - const char* USAGE_SHOW_TRANSFERS("show_transfers [in|out|all|pending|failed|pool|coinbase] [index=[,,...]] [ []]"); + const char* USAGE_SHOW_TRANSFERS("show_transfers [in|out|all|pending|failed|pool|coinbase|burnt|staked|yield] [index=[,,...]] [ []]"); const char* USAGE_UNSPENT_OUTPUTS("unspent_outputs [index=[,,...]] [ []]"); const char* USAGE_RESCAN_BC("rescan_bc [hard|soft|keep_ki] [start_height=0]"); const char* USAGE_SET_TX_NOTE("set_tx_note [free text note]"); @@ -3222,7 +3222,7 @@ bool simple_wallet::help(const std::vector &args/* = std::vector\" - Send whole balance to another wallet."); message_writer() << tr("\"seed\" - Show secret 25 words that can be used to recover this wallet."); message_writer() << tr("\"refresh\" - Synchronize wallet with the Salvium network."); @@ -3606,15 +3606,16 @@ simple_wallet::simple_wallet() // Seemingly broken formatting to compensate for the backslash before the quotes. tr("Show the incoming/outgoing transfers within an optional height range.\n\n" "Output format:\n" - "In or Coinbase: Block Number, \"block\"|\"in\", Time, Amount, Transaction Hash, Payment ID, Subaddress Index, \"-\", Note\n" - "Out: Block Number, \"out\", Time, Amount*, Transaction Hash, Payment ID, Fee, Destinations, Input addresses**, \"-\", Note\n" - "Pool: \"pool\", \"in\", Time, Amount, Transaction Hash, Payment Id, Subaddress Index, \"-\", Note, Double Spend Note\n" - "Pending or Failed: \"failed\"|\"pending\", \"out\", Time, Amount*, Transaction Hash, Payment ID, Fee, Input addresses**, \"-\", Note\n\n" + "In or Coinbase: Block Number, \"block\"|\"in\", Time, Amount, Asset Type, Transaction Hash, Payment ID, Subaddress Index, \"-\", Note\n" + "Out: Block Number, \"out\", Time, Amount*, Asset Type, Transaction Hash, Payment ID, Fee, Destinations, Input addresses**, \"-\", Note\n" + "Pool: \"pool\", \"in\", Time, Amount, Asset Type, Transaction Hash, Payment Id, Subaddress Index, \"-\", Note, Double Spend Note\n" + "Pending or Failed: \"failed\"|\"pending\", \"out\", Time, Amount*, Transaction Hash, Payment ID, Fee, Input addresses**, \"-\", Note\n" + "Staked or Burnt: Block Number, \"out\", Time, Amount*, Asset Type, Transaction Hash, Payment ID, Fee, Input addresses**, \"-\", Note\n\n" "* Excluding change and fee.\n" "** Set of address indices used as inputs in this transfer.")); m_cmd_binder.set_handler("export_transfers", boost::bind(&simple_wallet::on_command, this, &simple_wallet::export_transfers, _1), - tr("export_transfers [in|out|all|pending|failed|pool|coinbase|burnt|yield] [index=[,,...]] [ []] [output=] [option=]"), + tr("export_transfers [in|out|all|pending|failed|pool|coinbase|burnt|staked|yield] [index=[,,...]] [ []] [output=] [option=]"), tr("Export to CSV the incoming/outgoing transfers within an optional height range.")); m_cmd_binder.set_handler("unspent_outputs", boost::bind(&simple_wallet::on_command, this, &simple_wallet::unspent_outputs, _1), @@ -6962,7 +6963,7 @@ bool simple_wallet::transfer_main( fail_msg_writer() << tr("failed to get blockchain height: ") << err; return false; } - unlock_block = bc_height + locked_blocks; + unlock_block = locked_blocks; ptx_vector = m_wallet->create_transactions_2(dsts, source_asset, dest_asset, cryptonote::transaction_type::TRANSFER, fake_outs_count, unlock_block /* unlock_time */, priority, extra, m_current_subaddress_account, subaddr_indices, subtract_fee_from_outputs); break; default: @@ -7092,7 +7093,7 @@ bool simple_wallet::transfer_main( if (transfer_type == TransferLocked) { float days = locked_blocks / 720.0f; - prompt << boost::format(tr(".\nThis transaction (including %s change) will unlock on block %llu, in approximately %s days (assuming 2 minutes per block)")) % cryptonote::print_money(change) % ((unsigned long long)unlock_block) % days; + prompt << boost::format(tr(".\nThis transaction (including %s change) will unlock in %llu blocks, approximately %s days (assuming 2 minutes per block)")) % cryptonote::print_money(change) % ((unsigned long long)unlock_block) % days; } if (!process_ring_members(ptx_vector, prompt, m_wallet->print_ring_members())) return false; @@ -7272,7 +7273,7 @@ bool simple_wallet::locked_transfer(const std::vector &args_) local_args.pop_back(); } - transfer_main(Transfer, source_asset, source_asset, local_args, false); + transfer_main(TransferLocked, source_asset, source_asset, local_args, false); return true; } //---------------------------------------------------------------------------------------------------- @@ -9462,19 +9463,9 @@ bool simple_wallet::get_transfers(std::vector& local_args, std::vec if (!unlocked) { locked_msg = "locked"; - if (pd.m_unlock_time < CRYPTONOTE_MAX_BLOCK_NUMBER) - { - uint64_t bh = std::max(pd.m_unlock_time, pd.m_block_height + CRYPTONOTE_DEFAULT_TX_SPENDABLE_AGE); - if (bh >= last_block_height) - locked_msg = std::to_string(bh - last_block_height) + " blks"; - } - else - { - const uint64_t adjusted_time = m_wallet->get_daemon_adjusted_time(); - uint64_t threshold = adjusted_time + (m_wallet->use_fork_rules(2, 0) ? CRYPTONOTE_LOCKED_TX_ALLOWED_DELTA_SECONDS_V2 : CRYPTONOTE_LOCKED_TX_ALLOWED_DELTA_SECONDS_V1); - if (threshold < pd.m_unlock_time) - locked_msg = get_human_readable_timespan(std::chrono::seconds(pd.m_unlock_time - threshold)); - } + uint64_t bh = pd.m_block_height + std::max(pd.m_unlock_time, (uint64_t)CRYPTONOTE_DEFAULT_TX_SPENDABLE_AGE); + if (bh >= last_block_height) + locked_msg = std::to_string(bh - last_block_height) + " blks"; } transfers.push_back({ type, @@ -9483,7 +9474,7 @@ bool simple_wallet::get_transfers(std::vector& local_args, std::vec type, true, pd.m_amount, - pd.m_asset_type, + pd.m_asset_type, pd.m_tx_hash, payment_id, (pd.m_tx_type == cryptonote::transaction_type::STAKE) ? pd.m_fee : 0, @@ -9636,7 +9627,7 @@ bool simple_wallet::show_transfers(const std::vector &args_) std::vector local_args = args_; if(local_args.size() > 4) { - fail_msg_writer() << tr("usage: show_transfers [in|out|all|pending|failed|pool|coinbase] [index=[,,...]] [ []]"); + fail_msg_writer() << tr("usage: show_transfers [in|out|all|pending|failed|pool|coinbase|burnt|staked|yield] [index=[,,...]] [ []]"); return true; } @@ -9695,7 +9686,7 @@ bool simple_wallet::export_transfers(const std::vector& args_) std::vector local_args = args_; if(local_args.size() > 6) { - fail_msg_writer() << tr("usage: export_transfers [in|out|all|pending|failed|pool|coinbase] [index=[,,...]] [ []] [output=] [option=]"); + fail_msg_writer() << tr("usage: export_transfers [in|out|all|pending|failed|pool|coinbase|burnt|staked|yield] [index=[,,...]] [ []] [output=] [option=]"); return true; } diff --git a/src/version.cpp.in b/src/version.cpp.in index 2063f4c1c..2ac13936e 100644 --- a/src/version.cpp.in +++ b/src/version.cpp.in @@ -1,5 +1,5 @@ #define DEF_SALVIUM_VERSION_TAG "@VERSIONTAG@" -#define DEF_SALVIUM_VERSION "0.3.4" +#define DEF_SALVIUM_VERSION "0.3.6" #define DEF_MONERO_VERSION_TAG "release" #define DEF_MONERO_VERSION "0.18.3.3" #define DEF_MONERO_RELEASE_NAME "Zero" diff --git a/src/wallet/wallet2.cpp b/src/wallet/wallet2.cpp index d5a930d59..2b91dd73b 100644 --- a/src/wallet/wallet2.cpp +++ b/src/wallet/wallet2.cpp @@ -2223,14 +2223,17 @@ void wallet2::scan_output(const cryptonote::transaction &tx, bool miner_tx, cons { tx_scan_info.money_transfered = tools::decodeRct(tx.rct_signatures, tx_scan_info.received->derivation, i, tx_scan_info.mask, m_account.get_device()); } - /* + // SRCG: The following "if" block was commented out until v0.3.5 - wonder why??? if (tx_scan_info.money_transfered == 0) { MERROR("Invalid output amount, skipping"); tx_scan_info.error = true; return; } - */ + + // Populate the unlock_time + THROW_WALLET_EXCEPTION_IF(!cryptonote::get_output_unlock_time(tx.vout[i], tx_scan_info.unlock_time), error::wallet_internal_error, "failed to get output unlock_time"); + outs.push_back(i); THROW_WALLET_EXCEPTION_IF(tx_money_got_in_outs[tx_scan_info.received->index][tx_scan_info.asset_type] >= std::numeric_limits::max() - tx_scan_info.money_transfered, error::wallet_internal_error, "Overflow in received amounts"); @@ -2382,8 +2385,10 @@ void wallet2::process_new_transaction(const crypto::hash &txid, const cryptonote if (!miner_tx && !pool) process_unconfirmed(txid, tx, height); - std::string source_asset = tx.source_asset_type; - std::string dest_asset = tx.destination_asset_type; + std::string source_asset = + (tx.type == cryptonote::transaction_type::MINER) ? "SAL" : + (tx.type == cryptonote::transaction_type::PROTOCOL) ? "SAL" : + tx.source_asset_type; // per receiving subaddress index std::unordered_map> tx_money_got_in_outs; @@ -2407,7 +2412,7 @@ void wallet2::process_new_transaction(const crypto::hash &txid, const cryptonote size_t pk_index = 0; std::vector tx_scan_info(tx.vout.size()); std::deque output_found(tx.vout.size(), false); - uint64_t total_received_1 = 0; + std::map total_received_1; uint64_t td_origin_idx = ((uint64_t)-1); while (!tx.vout.empty()) { @@ -2679,7 +2684,11 @@ void wallet2::process_new_transaction(const crypto::hash &txid, const cryptonote if (!ignore_callbacks && 0 != m_callback) m_callback->on_money_received(height, txid, tx, td.m_amount, td.asset_type, 0, td.m_subaddr_index, spends_one_of_ours(tx), td.m_tx.unlock_time, td.m_td_origin_idx); } - total_received_1 += amount; + std::string asset_type = m_transfers.back().asset_type; + if (total_received_1.count(asset_type)) + total_received_1[asset_type] += amount; + else + total_received_1[asset_type] = amount; notify = true; if (tx.type == cryptonote::transaction_type::CONVERT || tx.type == cryptonote::transaction_type::STAKE) { @@ -2790,7 +2799,11 @@ void wallet2::process_new_transaction(const crypto::hash &txid, const cryptonote if (!ignore_callbacks && 0 != m_callback) m_callback->on_money_received(height, txid, tx, td.m_amount, td.asset_type, burnt, td.m_subaddr_index, spends_one_of_ours(tx), td.m_tx.unlock_time, td.m_td_origin_idx); } - total_received_1 += extra_amount; + std::string asset_type = m_transfers.back().asset_type; + if (total_received_1.count(asset_type)) + total_received_1[asset_type] += extra_amount; + else + total_received_1[asset_type] = extra_amount; notify = true; } } @@ -2975,51 +2988,84 @@ void wallet2::process_new_transaction(const crypto::hash &txid, const cryptonote } } - uint64_t total_received_2 = sub_change; + std::map total_received_2; for (auto& i : tx_money_got_in_outs) - total_received_2 += i.second[source_asset]; + for (auto& asset: i.second) + total_received_2[asset.first] += asset.second; // only for regular transfers - if (source_asset == dest_asset && !miner_tx) { - if (total_received_1 != total_received_2) - { - const el::Level level = el::Level::Warning; - MCLOG_RED(level, "global", "**********************************************************************"); - MCLOG_RED(level, "global", "Consistency failure in amounts received"); - MCLOG_RED(level, "global", "Check transaction " << txid); - MCLOG_RED(level, "global", "**********************************************************************"); - exit(1); - return; + if (!miner_tx) { + for (auto& asset: total_received_1) { + if (asset.second != total_received_2[asset.first]) { + //if (source_asset == dest_asset && !miner_tx) { + //if (total_received_1 != total_received_2) + //{ + const el::Level level = el::Level::Warning; + MCLOG_RED(level, "global", "**********************************************************************"); + MCLOG_RED(level, "global", "Consistency failure in amounts received"); + MCLOG_RED(level, "global", "Check transaction " << txid); + MCLOG_RED(level, "global", "**********************************************************************"); + exit(1); + return; + } } } bool all_same = true; - for (auto& i : tx_money_got_in_outs) - { - payment_details payment; - payment.m_tx_hash = txid; - payment.m_fee = fee; + std::vector temp_payments; + for (auto& tsi : tx_scan_info) { + if (!tsi.received) continue; + cryptonote::subaddress_index si = tsi.received->index; + bool updated_payment = false; + for (auto& payment : temp_payments) { + if (payment.m_subaddr_index == si && payment.m_unlock_time == tsi.unlock_time) { + // Add to existing payment + payment.m_amount += tsi.amount; + payment.m_amounts.push_back(tsi.amount); + updated_payment = true; + } + if (updated_payment) break; + } + if (updated_payment) continue; + + // Create a new payment + temp_payments.push_back(payment_details{}); + payment_details& payment = temp_payments.back(); + payment.m_tx_hash = txid; + payment.m_fee = fee; // SRCG - figure out what this needs to be (pretty sure we should never get here with CONVERT!) - payment.m_amount = source_asset == dest_asset ? i.second[dest_asset] : tx.amount_burnt; - payment.m_asset_type = (tx.type == cryptonote::transaction_type::PROTOCOL) ? "SAL" : dest_asset; - payment.m_amounts = tx_amounts_individual_outs[i.first]; - payment.m_block_height = height; - payment.m_unlock_time = tx.unlock_time; // SRCG: this is incorrect - work out which vout entry it is and query that - payment.m_timestamp = ts; - payment.m_coinbase = miner_tx; - payment.m_subaddr_index = i.first; - if (tx.type == cryptonote::transaction_type::PROTOCOL) { + payment.m_amount = tsi.amount; + payment.m_asset_type = tsi.asset_type; + payment.m_amounts.push_back(tsi.amount); + payment.m_block_height = height; + payment.m_unlock_time = tsi.unlock_time; + payment.m_timestamp = ts; + payment.m_coinbase = miner_tx; + payment.m_subaddr_index = si; + if (tx.type == cryptonote::transaction_type::MINER) { + + payment.m_unlock_time = CRYPTONOTE_MINED_MONEY_UNLOCK_WINDOW; // All protocol_tx payments are coinbase + payment.m_tx_type = cryptonote::transaction_type::MINER; + + } else if (tx.type == cryptonote::transaction_type::PROTOCOL) { + + payment.m_unlock_time = CRYPTONOTE_MINED_MONEY_UNLOCK_WINDOW; // All protocol_tx payments are coinbase if (td_origin_idx != ((uint64_t)-1)) { // Get the origin TD information - payment.m_amount = payment.m_amounts.empty() ? 0 : payment.m_amounts[0]; - payment.m_tx_type = m_transfers[td_origin_idx].m_tx.type; - payment.m_fee = m_transfers[td_origin_idx].m_tx.amount_burnt; + payment.m_amount = payment.m_amounts.empty() ? 0 : payment.m_amounts[0]; + payment.m_tx_type = m_transfers[td_origin_idx].m_tx.type; + payment.m_fee = m_transfers[td_origin_idx].m_tx.amount_burnt; } else { assert(false); } + } else { - payment.m_tx_type = tx.type; + payment.m_tx_type = tx.type; } + } + + // Now iterate over the temp_payment entries + for (auto& payment : temp_payments) { if (pool) { if (emplace_or_replace(m_unconfirmed_payments, payment_id, pool_payment_details{payment, double_spend_seen})) all_same = false; @@ -3030,7 +3076,6 @@ void wallet2::process_new_transaction(const crypto::hash &txid, const cryptonote m_payments.emplace(payment_id, payment); LOG_PRINT_L2("Payment found in " << (pool ? "pool" : "block") << ": " << payment_id << " / " << payment.m_tx_hash << " / " << payment.m_amount); } - // if it's a pool tx and we already had it, don't notify again if (pool && all_same) notify = false; @@ -6871,14 +6916,16 @@ std::map>> wallet2:: } else { - uint64_t unlock_height = td.m_block_height + std::max(CRYPTONOTE_DEFAULT_TX_SPENDABLE_AGE, CRYPTONOTE_LOCKED_TX_ALLOWED_DELTA_BLOCKS); - if (td.m_tx.unlock_time < CRYPTONOTE_MAX_BLOCK_NUMBER && td.m_tx.unlock_time > unlock_height) - unlock_height = td.m_tx.unlock_time; - if (td.m_tx.type == cryptonote::transaction_type::MINER) + uint64_t unlock_height = 0; + if (td.m_tx.type == cryptonote::transaction_type::MINER || td.m_tx.type == cryptonote::transaction_type::PROTOCOL) unlock_height = td.m_block_height + CRYPTONOTE_MINED_MONEY_UNLOCK_WINDOW; - uint64_t unlock_time = td.m_tx.unlock_time >= CRYPTONOTE_MAX_BLOCK_NUMBER ? td.m_tx.unlock_time : 0; - blocks_to_unlock = unlock_height > blockchain_height ? unlock_height - blockchain_height : 0; - time_to_unlock = unlock_time > now ? unlock_time - now : 0; + else { + uint64_t unlock_blocks = 0; + THROW_WALLET_EXCEPTION_IF(!cryptonote::get_output_unlock_time(td.m_tx.vout[td.m_internal_output_index], unlock_blocks), error::wallet_internal_error, "failed to get unlock_time"); + unlock_height = td.m_block_height + ((unlock_blocks > CRYPTONOTE_DEFAULT_TX_SPENDABLE_AGE) ? unlock_blocks : CRYPTONOTE_DEFAULT_TX_SPENDABLE_AGE); + } + blocks_to_unlock = (unlock_height > blockchain_height) ? unlock_height - blockchain_height : 0; + time_to_unlock = 0; amount = 0; } auto found = amount_per_subaddr.find(td.m_subaddr_index.minor); diff --git a/src/wallet/wallet2.h b/src/wallet/wallet2.h index ab7b1faba..4cb4c9732 100644 --- a/src/wallet/wallet2.h +++ b/src/wallet/wallet2.h @@ -320,12 +320,13 @@ private: rct::key mask; uint64_t amount; std::string asset_type; + uint64_t unlock_time; uint64_t money_transfered; uint64_t origin_idx; bool error; boost::optional received; - tx_scan_info_t(): amount(0), asset_type(""), money_transfered(0), origin_idx((uint64_t)-1), error(true) {} + tx_scan_info_t(): amount(0), asset_type(""), unlock_time(0), money_transfered(0), origin_idx((uint64_t)-1), error(true) {} }; struct transfer_details diff --git a/src/wallet/wallet_rpc_server.cpp b/src/wallet/wallet_rpc_server.cpp index 9caf7f048..5d7309fc1 100644 --- a/src/wallet/wallet_rpc_server.cpp +++ b/src/wallet/wallet_rpc_server.cpp @@ -358,6 +358,7 @@ namespace tools entry.timestamp = pd.m_timestamp; entry.amount = pd.m_amount; entry.amounts = pd.m_amounts; + entry.asset_type = pd.m_asset_type; entry.unlock_time = pd.m_unlock_time; entry.locked = !m_wallet->is_transfer_unlocked(pd.m_unlock_time, pd.m_block_height); entry.fee = pd.m_fee; diff --git a/src/wallet/wallet_rpc_server_commands_defs.h b/src/wallet/wallet_rpc_server_commands_defs.h index a412b42aa..ee1bcfa7c 100644 --- a/src/wallet/wallet_rpc_server_commands_defs.h +++ b/src/wallet/wallet_rpc_server_commands_defs.h @@ -1439,6 +1439,7 @@ namespace wallet_rpc uint64_t amount; amounts_container amounts; uint64_t fee; + std::string asset_type; std::string note; std::list destinations; std::string type; @@ -1460,6 +1461,7 @@ namespace wallet_rpc KV_SERIALIZE(amounts); KV_SERIALIZE(fee); KV_SERIALIZE(note); + KV_SERIALIZE(asset_type); KV_SERIALIZE(destinations); KV_SERIALIZE(type); KV_SERIALIZE(unlock_time)