Compare commits
15 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 69480b79e7 | |||
| 203cc7ee45 | |||
| 075ba14f9f | |||
| 126caed899 | |||
| 3a2be26feb | |||
| aeea005c95 | |||
| 2a0c17480e | |||
| 584890ab25 | |||
| 759531eff5 | |||
| f582757dae | |||
| 43eaed7a76 | |||
| 32d9edee1a | |||
| c49aacf389 | |||
| 2726b0556a | |||
| 2e33174d2e |
@@ -1,4 +1,5 @@
|
||||
// Copyright (c) 2014-2023, The Monero Project
|
||||
// Portions Copyright (c) 2023-2024, Salvium (author: SRCG)
|
||||
//
|
||||
// All rights reserved.
|
||||
//
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// Copyright (c) 2014-2023, The Monero Project
|
||||
// Portions Copyright (c) 2023, Salvium (author: SRCG)
|
||||
// Portions Copyright (c) 2023-2024, Salvium (author: SRCG)
|
||||
// All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without modification, are
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
// Copyright (c) 2014-2022, The Monero Project
|
||||
// Portions Copyright (c) 2023-2024, Salvium (author: SRCG)
|
||||
//
|
||||
// All rights reserved.
|
||||
//
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
// Copyright (c) 2014-2022, The Monero Project
|
||||
// Portions Copyright (c) 2023-2024, Salvium (author: SRCG)
|
||||
//
|
||||
// All rights reserved.
|
||||
//
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
// Copyright (c) 2014-2022, The Monero Project
|
||||
// Portions Copyright (c) 2023-2024, Salvium (author: SRCG)
|
||||
//
|
||||
// All rights reserved.
|
||||
//
|
||||
|
||||
@@ -216,7 +216,7 @@
|
||||
#define HF_VERSION_ENABLE_ORACLE 2
|
||||
#define HF_VERSION_SLIPPAGE_YIELD 2
|
||||
|
||||
#define TESTNET_VERSION 5
|
||||
#define TESTNET_VERSION 6
|
||||
#define STAGENET_VERSION 1
|
||||
|
||||
#define PER_KB_FEE_QUANTIZATION_DECIMALS 8
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
// Copyright (c) 2014-2022, The Monero Project
|
||||
// Portions Copyright (c) 2023-2024, Salvium (author: SRCG)
|
||||
//
|
||||
// All rights reserved.
|
||||
//
|
||||
@@ -1422,10 +1423,7 @@ bool Blockchain::prevalidate_protocol_transaction(const block& b, uint64_t heigh
|
||||
return false;
|
||||
}
|
||||
MDEBUG("Protocol tx hash: " << get_transaction_hash(b.protocol_tx));
|
||||
//CHECK_AND_ASSERT_MES(b.protocol_tx.unlock_time == height, false, "coinbase protocol transaction transaction has the wrong unlock time=" << b.protocol_tx.unlock_time << ", expected " << height + CRYPTONOTE_MINED_MONEY_UNLOCK_WINDOW);
|
||||
|
||||
// SRCG - we still need to make output checks
|
||||
/*
|
||||
//check outs overflow
|
||||
if(!check_outs_overflow(b.protocol_tx))
|
||||
{
|
||||
@@ -1433,8 +1431,8 @@ bool Blockchain::prevalidate_protocol_transaction(const block& b, uint64_t heigh
|
||||
return false;
|
||||
}
|
||||
|
||||
CHECK_AND_ASSERT_MES(check_output_types(b.miner_tx, hf_version), false, "miner transaction has invalid output type(s) in block " << get_block_hash(b));
|
||||
*/
|
||||
CHECK_AND_ASSERT_MES(check_output_types(b.protocol_tx, hf_version), false, "protocol transaction has invalid output type(s) in block " << get_block_hash(b));
|
||||
|
||||
return true;
|
||||
}
|
||||
//------------------------------------------------------------------
|
||||
@@ -1496,9 +1494,11 @@ bool Blockchain::validate_protocol_transaction(const block& b, uint64_t height,
|
||||
for (auto& o : b.protocol_tx.vout) {
|
||||
if (o.target.type() == typeid(txout_to_key)) {
|
||||
txout_to_key out = boost::get<txout_to_key>(o.target);
|
||||
CHECK_AND_ASSERT_MES(out.unlock_time == CRYPTONOTE_MINED_MONEY_UNLOCK_WINDOW, false, "Invalid unlock time on protocol_tx output");
|
||||
outputs[out.key] = {out.asset_type, o.amount, out.unlock_time};
|
||||
} else if (o.target.type() == typeid(txout_to_tagged_key)) {
|
||||
txout_to_tagged_key out = boost::get<txout_to_tagged_key>(o.target);
|
||||
CHECK_AND_ASSERT_MES(out.unlock_time == CRYPTONOTE_MINED_MONEY_UNLOCK_WINDOW, false, "Invalid unlock time on protocol_tx output");
|
||||
outputs[out.key] = {out.asset_type, o.amount, out.unlock_time};
|
||||
} else {
|
||||
MERROR("Block at height: " << height << " attempting to add protocol transaction with invalid type " << o.target.type().name());
|
||||
@@ -1566,7 +1566,7 @@ bool Blockchain::validate_protocol_transaction(const block& b, uint64_t height,
|
||||
return false;
|
||||
}
|
||||
if (amount_minted_check != output_amount) {
|
||||
LOG_ERROR("Block at height: " << height << " - Output amount does not match amount_burnt for refunded TX id " << tx->hash << " - rejecting block");
|
||||
LOG_ERROR("Block at height: " << height << " - Output amount does not match amount minted for converted TX id " << tx->hash << " - rejecting block");
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1581,12 +1581,12 @@ bool Blockchain::validate_protocol_transaction(const block& b, uint64_t height,
|
||||
}
|
||||
|
||||
// Can we have matured STAKE transactions yet?
|
||||
uint64_t lock_period = get_config(m_nettype).STAKE_LOCK_PERIOD;
|
||||
if (height > lock_period) {
|
||||
uint64_t stake_lock_period = get_config(m_nettype).STAKE_LOCK_PERIOD;
|
||||
if (height > stake_lock_period) {
|
||||
|
||||
// Yes - Get the staking data for the block that matured this time
|
||||
cryptonote::yield_block_info ybi_matured;
|
||||
uint64_t matured_height = height - lock_period - 1;
|
||||
uint64_t matured_height = height - stake_lock_period - 1;
|
||||
bool ok = get_ybi_entry(matured_height, ybi_matured);
|
||||
if (ok && ybi_matured.locked_coins_this_block > 0) {
|
||||
|
||||
|
||||
@@ -171,7 +171,7 @@ namespace cryptonote
|
||||
static const command_line::arg_descriptor<std::string> arg_check_updates = {
|
||||
"check-updates"
|
||||
, "Check for new versions of monero: [disabled|notify|download|update]"
|
||||
, "notify"
|
||||
, "disabled"
|
||||
};
|
||||
static const command_line::arg_descriptor<bool> arg_fluffy_blocks = {
|
||||
"fluffy-blocks"
|
||||
@@ -519,6 +519,12 @@ namespace cryptonote
|
||||
return false;
|
||||
}
|
||||
|
||||
if (m_nettype == STAGENET) {
|
||||
folder /= std::to_string(STAGENET_VERSION);
|
||||
} else if (m_nettype == TESTNET) {
|
||||
folder /= std::to_string(TESTNET_VERSION);
|
||||
}
|
||||
|
||||
folder /= db->get_db_name();
|
||||
MGINFO("Loading blockchain from folder " << folder.string() << " ...");
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// Copyright (c) 2014-2022, The Monero Project
|
||||
// Portions Copyright (c) 2023, Salvium (author: SRCG)
|
||||
// Portions Copyright (c) 2023-2024, Salvium (author: SRCG)
|
||||
//
|
||||
// All rights reserved.
|
||||
//
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
// Copyright (c) 2014-2022, The Monero Project
|
||||
// Portions Copyright (c) 2023-2024, Salvium (author: SRCG)
|
||||
//
|
||||
// All rights reserved.
|
||||
//
|
||||
|
||||
@@ -615,8 +615,8 @@ bool t_rpc_command_executor::mining_status() {
|
||||
uint64_t daily = 86400ull / mres.block_target * mres.block_reward * ratio;
|
||||
uint64_t monthly = 86400ull / mres.block_target * 30.5 * mres.block_reward * ratio;
|
||||
uint64_t yearly = 86400ull / mres.block_target * 356 * mres.block_reward * ratio;
|
||||
tools::msg_writer() << "Expected: " << cryptonote::print_money(daily) << " monero daily, "
|
||||
<< cryptonote::print_money(monthly) << " monero monthly, " << cryptonote::print_money(yearly) << " yearly";
|
||||
tools::msg_writer() << "Expected: " << (daily / COIN) << " SALs daily, "
|
||||
<< (monthly / COIN) << " SALs monthly, " << (yearly / COIN) << " yearly";
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
// Copyright (c) 2016, Monero Research Labs
|
||||
// Portions Copyright (c) 2023-2024, Salvium (author: SRCG)
|
||||
//
|
||||
// Author: Shen Noether <shen.noether@gmx.com>
|
||||
//
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
// Copyright (c) 2016, Monero Research Labs
|
||||
// Portions Copyright (c) 2023-2024, Salvium (author: SRCG)
|
||||
//
|
||||
// Author: Shen Noether <shen.noether@gmx.com>
|
||||
//
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
// Copyright (c) 2016, Monero Research Labs
|
||||
// Portions Copyright (c) 2023-2024, Salvium (author: SRCG)
|
||||
//
|
||||
// Author: Shen Noether <shen.noether@gmx.com>
|
||||
//
|
||||
|
||||
@@ -1486,7 +1486,7 @@ namespace cryptonote
|
||||
res.is_background_mining_enabled = lMiner.get_is_background_mining_enabled();
|
||||
store_difficulty(m_core.get_blockchain_storage().get_difficulty_for_next_block(), res.difficulty, res.wide_difficulty, res.difficulty_top64);
|
||||
|
||||
res.block_target = m_core.get_blockchain_storage().get_current_hard_fork_version() < 2 ? DIFFICULTY_TARGET_V1 : DIFFICULTY_TARGET_V2;
|
||||
res.block_target = DIFFICULTY_TARGET_V2;
|
||||
if ( lMiner.is_mining() ) {
|
||||
res.speed = lMiner.get_speed();
|
||||
res.threads_count = lMiner.get_threads_count();
|
||||
@@ -1495,17 +1495,9 @@ namespace cryptonote
|
||||
const account_public_address& lMiningAdr = lMiner.get_mining_address();
|
||||
if (lMiner.is_mining() || lMiner.get_is_background_mining_enabled())
|
||||
res.address = get_account_address_as_str(nettype(), false, lMiningAdr);
|
||||
const uint8_t major_version = m_core.get_blockchain_storage().get_current_hard_fork_version();
|
||||
const unsigned variant = major_version >= 7 ? major_version - 6 : 0;
|
||||
switch (variant)
|
||||
{
|
||||
case 0: res.pow_algorithm = "Cryptonight"; break;
|
||||
case 1: res.pow_algorithm = "CNv1 (Cryptonight variant 1)"; break;
|
||||
case 2: case 3: res.pow_algorithm = "CNv2 (Cryptonight variant 2)"; break;
|
||||
case 4: case 5: res.pow_algorithm = "CNv4 (Cryptonight variant 4)"; break;
|
||||
case 6: case 7: case 8: case 9: res.pow_algorithm = "RandomX"; break;
|
||||
default: res.pow_algorithm = "RandomX"; break; // assumed
|
||||
}
|
||||
|
||||
res.pow_algorithm = "RandomX";
|
||||
|
||||
if (res.is_background_mining_enabled)
|
||||
{
|
||||
res.bg_idle_threshold = lMiner.get_idle_threshold();
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
// Copyright (c) 2014-2022, The Monero Project
|
||||
// Portions Copyright (c) 2023-2024, Salvium (author: SRCG)
|
||||
//
|
||||
// All rights reserved.
|
||||
//
|
||||
@@ -7995,6 +7996,12 @@ bool simple_wallet::sweep_below(const std::vector<std::string> &args_)
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
bool simple_wallet::return_payment(const std::vector<std::string> &args_)
|
||||
{
|
||||
// Disable until appropriate hard fork
|
||||
if (m_wallet->get_current_hard_fork() < HF_VERSION_ENABLE_RETURN) {
|
||||
fail_msg_writer() << tr("return_payments are disabled");
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!try_connect_to_daemon())
|
||||
return true;
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
// Copyright (c) 2014-2022, The Monero Project
|
||||
// Portions Copyright (c) 2023-2024, Salvium (author: SRCG)
|
||||
//
|
||||
// All rights reserved.
|
||||
//
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
#define DEF_SALVIUM_VERSION_TAG "7f6b8da"
|
||||
#define DEF_SALVIUM_VERSION "0.2.3"
|
||||
#define DEF_SALVIUM_VERSION "0.2.6"
|
||||
#define DEF_MONERO_VERSION_TAG "@VERSIONTAG@"
|
||||
#define DEF_MONERO_VERSION "0.18.3.3"
|
||||
#define DEF_MONERO_RELEASE_NAME "Zero"
|
||||
|
||||
@@ -64,8 +64,8 @@ void SubaddressAccountImpl::refresh()
|
||||
i,
|
||||
m_wallet->m_wallet->get_subaddress_as_str({i,0}),
|
||||
m_wallet->m_wallet->get_subaddress_label({i,0}),
|
||||
cryptonote::print_money(m_wallet->m_wallet->balance(i, false)),
|
||||
cryptonote::print_money(m_wallet->m_wallet->unlocked_balance(i, false))
|
||||
cryptonote::print_money(m_wallet->m_wallet->balance(i, "SAL", false)),
|
||||
cryptonote::print_money(m_wallet->m_wallet->unlocked_balance(i, "SAL", false))
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
+10
-82
@@ -211,38 +211,6 @@ struct Wallet2CallbackImpl : public tools::i_wallet2_callback
|
||||
// TODO;
|
||||
}
|
||||
|
||||
// Light wallet callbacks
|
||||
virtual void on_lw_new_block(uint64_t height)
|
||||
{
|
||||
if (m_listener) {
|
||||
m_listener->newBlock(height);
|
||||
}
|
||||
}
|
||||
|
||||
virtual void on_lw_money_received(uint64_t height, const crypto::hash &txid, uint64_t amount)
|
||||
{
|
||||
if (m_listener) {
|
||||
std::string tx_hash = epee::string_tools::pod_to_hex(txid);
|
||||
m_listener->moneyReceived(tx_hash, amount);
|
||||
}
|
||||
}
|
||||
|
||||
virtual void on_lw_unconfirmed_money_received(uint64_t height, const crypto::hash &txid, uint64_t amount)
|
||||
{
|
||||
if (m_listener) {
|
||||
std::string tx_hash = epee::string_tools::pod_to_hex(txid);
|
||||
m_listener->unconfirmedMoneyReceived(tx_hash, amount);
|
||||
}
|
||||
}
|
||||
|
||||
virtual void on_lw_money_spent(uint64_t height, const crypto::hash &txid, uint64_t amount)
|
||||
{
|
||||
if (m_listener) {
|
||||
std::string tx_hash = epee::string_tools::pod_to_hex(txid);
|
||||
m_listener->moneySpent(tx_hash, amount);
|
||||
}
|
||||
}
|
||||
|
||||
virtual void on_device_button_request(uint64_t code)
|
||||
{
|
||||
if (m_listener) {
|
||||
@@ -952,42 +920,11 @@ string WalletImpl::keysFilename() const
|
||||
bool WalletImpl::init(const std::string &daemon_address, uint64_t upper_transaction_size_limit, const std::string &daemon_username, const std::string &daemon_password, bool use_ssl, bool lightWallet, const std::string &proxy_address)
|
||||
{
|
||||
clearStatus();
|
||||
m_wallet->set_light_wallet(lightWallet);
|
||||
if(daemon_username != "")
|
||||
m_daemon_login.emplace(daemon_username, daemon_password);
|
||||
return doInit(daemon_address, proxy_address, upper_transaction_size_limit, use_ssl);
|
||||
}
|
||||
|
||||
bool WalletImpl::lightWalletLogin(bool &isNewWallet) const
|
||||
{
|
||||
return m_wallet->light_wallet_login(isNewWallet);
|
||||
}
|
||||
|
||||
bool WalletImpl::lightWalletImportWalletRequest(std::string &payment_id, uint64_t &fee, bool &new_request, bool &request_fulfilled, std::string &payment_address, std::string &status)
|
||||
{
|
||||
try
|
||||
{
|
||||
tools::COMMAND_RPC_IMPORT_WALLET_REQUEST::response response;
|
||||
if(!m_wallet->light_wallet_import_wallet_request(response)){
|
||||
setStatusError(tr("Failed to send import wallet request"));
|
||||
return false;
|
||||
}
|
||||
fee = response.import_fee;
|
||||
payment_id = response.payment_id;
|
||||
new_request = response.new_request;
|
||||
request_fulfilled = response.request_fulfilled;
|
||||
payment_address = response.payment_address;
|
||||
status = response.status;
|
||||
}
|
||||
catch (const std::exception &e)
|
||||
{
|
||||
LOG_ERROR("Error sending import wallet request: " << e.what());
|
||||
setStatusError(e.what());
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
void WalletImpl::setRefreshFromBlockHeight(uint64_t refresh_from_block_height)
|
||||
{
|
||||
m_wallet->set_refresh_from_block_height(refresh_from_block_height);
|
||||
@@ -1010,19 +947,16 @@ void WalletImpl::setSubaddressLookahead(uint32_t major, uint32_t minor)
|
||||
|
||||
uint64_t WalletImpl::balance(uint32_t accountIndex) const
|
||||
{
|
||||
return m_wallet->balance(accountIndex, false);
|
||||
return m_wallet->balance(accountIndex, "SAL", false);
|
||||
}
|
||||
|
||||
uint64_t WalletImpl::unlockedBalance(uint32_t accountIndex) const
|
||||
{
|
||||
return m_wallet->unlocked_balance(accountIndex, false);
|
||||
return m_wallet->unlocked_balance(accountIndex, "SAL", false);
|
||||
}
|
||||
|
||||
uint64_t WalletImpl::blockChainHeight() const
|
||||
{
|
||||
if(m_wallet->light_wallet()) {
|
||||
return m_wallet->get_light_wallet_scanned_block_height();
|
||||
}
|
||||
return m_wallet->get_blockchain_current_height();
|
||||
}
|
||||
uint64_t WalletImpl::approximateBlockChainHeight() const
|
||||
@@ -1037,9 +971,6 @@ uint64_t WalletImpl::estimateBlockChainHeight() const
|
||||
|
||||
uint64_t WalletImpl::daemonBlockChainHeight() const
|
||||
{
|
||||
if(m_wallet->light_wallet()) {
|
||||
return m_wallet->get_light_wallet_scanned_block_height();
|
||||
}
|
||||
if (!m_is_connected)
|
||||
return 0;
|
||||
std::string err;
|
||||
@@ -1056,9 +987,6 @@ uint64_t WalletImpl::daemonBlockChainHeight() const
|
||||
|
||||
uint64_t WalletImpl::daemonBlockChainTargetHeight() const
|
||||
{
|
||||
if(m_wallet->light_wallet()) {
|
||||
return m_wallet->get_light_wallet_blockchain_height();
|
||||
}
|
||||
if (!m_is_connected)
|
||||
return 0;
|
||||
std::string err;
|
||||
@@ -1590,13 +1518,13 @@ PendingTransaction *WalletImpl::createTransactionMultDest(const std::vector<stri
|
||||
fake_outs_count = m_wallet->adjust_mixin(mixin_count);
|
||||
|
||||
if (amount) {
|
||||
transaction->m_pending_tx = m_wallet->create_transactions_2(dsts, fake_outs_count, 0 /* unlock_time */,
|
||||
transaction->m_pending_tx = m_wallet->create_transactions_2(dsts, "SAL", "SAL", cryptonote::transaction_type::TRANSFER, fake_outs_count, 0 /* unlock_time */,
|
||||
adjusted_priority,
|
||||
extra, subaddr_account, subaddr_indices);
|
||||
} else {
|
||||
transaction->m_pending_tx = m_wallet->create_transactions_all(0, cryptonote::transaction_type::TRANSFER, "SAL", info.address, info.is_subaddress, 1, fake_outs_count, 0 /* unlock_time */,
|
||||
adjusted_priority,
|
||||
extra, subaddr_account, subaddr_indices);
|
||||
} else {
|
||||
transaction->m_pending_tx = m_wallet->create_transactions_all(0, info.address, info.is_subaddress, 1, fake_outs_count, 0 /* unlock_time */,
|
||||
adjusted_priority,
|
||||
extra, subaddr_account, subaddr_indices);
|
||||
}
|
||||
pendingTxPostProcess(transaction);
|
||||
|
||||
@@ -2183,13 +2111,13 @@ Wallet::ConnectionStatus WalletImpl::connected() const
|
||||
m_is_connected = m_wallet->check_connection(&version, NULL, DEFAULT_CONNECTION_TIMEOUT_MILLIS, &wallet_is_outdated, &daemon_is_outdated);
|
||||
if (!m_is_connected)
|
||||
{
|
||||
if (!m_wallet->light_wallet() && (wallet_is_outdated || daemon_is_outdated))
|
||||
if (wallet_is_outdated || daemon_is_outdated)
|
||||
return Wallet::ConnectionStatus_WrongVersion;
|
||||
else
|
||||
return Wallet::ConnectionStatus_Disconnected;
|
||||
}
|
||||
// Version check is not implemented in light wallets nodes/wallets
|
||||
if (!m_wallet->light_wallet() && (version >> 16) != CORE_RPC_VERSION_MAJOR)
|
||||
if ((version >> 16) != CORE_RPC_VERSION_MAJOR)
|
||||
return Wallet::ConnectionStatus_WrongVersion;
|
||||
return Wallet::ConnectionStatus_Connected;
|
||||
}
|
||||
@@ -2283,7 +2211,7 @@ void WalletImpl::doRefresh()
|
||||
LOG_PRINT_L3(__FUNCTION__ << ": doRefresh, rescan = "<<rescan);
|
||||
// Syncing daemon and refreshing wallet simultaneously is very resource intensive.
|
||||
// Disable refresh if wallet is disconnected or daemon isn't synced.
|
||||
if (m_wallet->light_wallet() || daemonSynced()) {
|
||||
if (daemonSynced()) {
|
||||
if(rescan)
|
||||
m_wallet->rescan_blockchain(false);
|
||||
m_wallet->refresh(trustedDaemon());
|
||||
|
||||
@@ -207,8 +207,6 @@ public:
|
||||
virtual bool parse_uri(const std::string &uri, std::string &address, std::string &payment_id, uint64_t &amount, std::string &tx_description, std::string &recipient_name, std::vector<std::string> &unknown_parameters, std::string &error) override;
|
||||
virtual std::string make_uri(const std::string &address, const std::string &payment_id, uint64_t amount, const std::string &tx_description, const std::string &recipient_name, std::string &error) const override;
|
||||
virtual std::string getDefaultDataDir() const override;
|
||||
virtual bool lightWalletLogin(bool &isNewWallet) const override;
|
||||
virtual bool lightWalletImportWalletRequest(std::string &payment_id, uint64_t &fee, bool &new_request, bool &request_fulfilled, std::string &payment_address, std::string &status) override;
|
||||
virtual bool blackballOutputs(const std::vector<std::string> &outputs, bool add) override;
|
||||
virtual bool blackballOutput(const std::string &amount, const std::string &offset) override;
|
||||
virtual bool unblackballOutput(const std::string &amount, const std::string &offset) override;
|
||||
|
||||
@@ -1066,12 +1066,6 @@ struct Wallet
|
||||
//! secondary key reuse mitigation
|
||||
virtual void keyReuseMitigation2(bool mitigation) = 0;
|
||||
|
||||
//! Light wallet authenticate and login
|
||||
virtual bool lightWalletLogin(bool &isNewWallet) const = 0;
|
||||
|
||||
//! Initiates a light wallet import wallet request
|
||||
virtual bool lightWalletImportWalletRequest(std::string &payment_id, uint64_t &fee, bool &new_request, bool &request_fulfilled, std::string &payment_address, std::string &status) = 0;
|
||||
|
||||
//! locks/unlocks the keys file; returns true on success
|
||||
virtual bool lockKeysFile() = 0;
|
||||
virtual bool unlockKeysFile() = 0;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
// Copyright (c) 2014-2022, The Monero Project
|
||||
// Portions Copyright (c) 2023-2024, Salvium (author: SRCG)
|
||||
//
|
||||
// All rights reserved.
|
||||
//
|
||||
@@ -9208,7 +9209,7 @@ void wallet2::get_outs(std::vector<std::vector<tools::wallet2::get_outs_entry>>
|
||||
{
|
||||
MINFO("Using it");
|
||||
//req.outputs.push_back({amount, out, true}); // Rings are stored referencing global output IDs
|
||||
add_output_to_lists({amount, out});
|
||||
add_output_to_lists({amount, out, true});
|
||||
++num_found;
|
||||
seen_indices.emplace(out);
|
||||
if (out == td.m_global_output_index)
|
||||
@@ -9496,7 +9497,7 @@ void wallet2::get_outs(std::vector<std::vector<tools::wallet2::get_outs_entry>>
|
||||
break;
|
||||
}
|
||||
}
|
||||
THROW_WALLET_EXCEPTION_IF(!found, error::wallet_internal_error, "Falied to find existing ring output in daemon out data");
|
||||
THROW_WALLET_EXCEPTION_IF(!found, error::wallet_internal_error, "Failed to find existing ring output in daemon out data");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+2
-38
@@ -1,4 +1,5 @@
|
||||
// Copyright (c) 2014-2022, The Monero Project
|
||||
// Portions Copyright (c) 2023-2024, Salvium (author: SRCG)
|
||||
//
|
||||
// All rights reserved.
|
||||
//
|
||||
@@ -1045,14 +1046,6 @@ private:
|
||||
bool is_deterministic() const;
|
||||
bool get_seed(epee::wipeable_string& electrum_words, const epee::wipeable_string &passphrase = epee::wipeable_string()) const;
|
||||
|
||||
/*!
|
||||
* \brief Checks if light wallet. A light wallet sends view key to a server where the blockchain is scanned.
|
||||
*/
|
||||
bool light_wallet() const { return m_light_wallet; }
|
||||
void set_light_wallet(bool light_wallet) { m_light_wallet = light_wallet; }
|
||||
uint64_t get_light_wallet_scanned_block_height() const { return m_light_wallet_scanned_block_height; }
|
||||
uint64_t get_light_wallet_blockchain_height() const { return m_light_wallet_blockchain_height; }
|
||||
|
||||
/*!
|
||||
* \brief Gets the seed language
|
||||
*/
|
||||
@@ -1186,7 +1179,7 @@ private:
|
||||
void get_unconfirmed_payments_out(std::list<std::pair<crypto::hash,wallet2::unconfirmed_transfer_details>>& unconfirmed_payments, const boost::optional<uint32_t>& subaddr_account = boost::none, const std::set<uint32_t>& subaddr_indices = {}) const;
|
||||
void get_unconfirmed_payments(std::list<std::pair<crypto::hash,wallet2::pool_payment_details>>& unconfirmed_payments, const boost::optional<uint32_t>& subaddr_account = boost::none, const std::set<uint32_t>& subaddr_indices = {}) const;
|
||||
|
||||
uint64_t get_blockchain_current_height() const { return m_light_wallet_blockchain_height ? m_light_wallet_blockchain_height : m_blockchain.size(); }
|
||||
uint64_t get_blockchain_current_height() const { return m_blockchain.size(); }
|
||||
void rescan_spent();
|
||||
void rescan_blockchain(bool hard, bool refresh = true, bool keep_key_images = false);
|
||||
bool is_transfer_unlocked(const transfer_details& td);
|
||||
@@ -1648,24 +1641,6 @@ private:
|
||||
}
|
||||
template<typename T> void handle_payment_changes(const T &res, std::false_type) {}
|
||||
|
||||
// Light wallet specific functions
|
||||
// fetch unspent outs from lw node and store in m_transfers
|
||||
void light_wallet_get_unspent_outs();
|
||||
// fetch txs and store in m_payments
|
||||
void light_wallet_get_address_txs();
|
||||
// get_address_info
|
||||
bool light_wallet_get_address_info(tools::COMMAND_RPC_GET_ADDRESS_INFO::response &response);
|
||||
// Login. new_address is true if address hasn't been used on lw node before.
|
||||
bool light_wallet_login(bool &new_address);
|
||||
// Send an import request to lw node. returns info about import fee, address and payment_id
|
||||
bool light_wallet_import_wallet_request(tools::COMMAND_RPC_IMPORT_WALLET_REQUEST::response &response);
|
||||
// get random outputs from light wallet server
|
||||
void light_wallet_get_outs(std::vector<std::vector<get_outs_entry>> &outs, const std::vector<size_t> &selected_transfers, size_t fake_outputs_count);
|
||||
// Parse rct string
|
||||
bool light_wallet_parse_rct_str(const std::string& rct_string, const crypto::public_key& tx_pub_key, uint64_t internal_output_index, rct::key& decrypted_mask, rct::key& rct_commit, bool decrypt) const;
|
||||
// check if key image is ours
|
||||
bool light_wallet_key_image_is_ours(const crypto::key_image& key_image, const crypto::public_key& tx_public_key, uint64_t out_index);
|
||||
|
||||
/*
|
||||
* "attributes" are a mechanism to store an arbitrary number of string values
|
||||
* on the level of the wallet as a whole, identified by keys. Their introduction,
|
||||
@@ -1999,17 +1974,6 @@ private:
|
||||
// Aux transaction data from device
|
||||
serializable_unordered_map<crypto::hash, std::string> m_tx_device;
|
||||
|
||||
// Light wallet
|
||||
bool m_light_wallet; /* sends view key to daemon for scanning */
|
||||
uint64_t m_light_wallet_scanned_block_height;
|
||||
uint64_t m_light_wallet_blockchain_height;
|
||||
uint64_t m_light_wallet_per_kb_fee = FEE_PER_KB;
|
||||
bool m_light_wallet_connected;
|
||||
uint64_t m_light_wallet_balance;
|
||||
uint64_t m_light_wallet_unlocked_balance;
|
||||
// Light wallet info needed to populate m_payment requires 2 separate api calls (get_address_txs and get_unspent_outs)
|
||||
// We save the info from the first call in m_light_wallet_address_txs for easier lookup.
|
||||
std::unordered_map<crypto::hash, address_tx> m_light_wallet_address_txs;
|
||||
// store calculated key image for faster lookup
|
||||
serializable_unordered_map<crypto::public_key, serializable_map<uint64_t, crypto::key_image> > m_key_image_cache;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user