Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1998d79c3e | ||
|
|
ea4d5a9132 | ||
|
|
585f7b9d05 | ||
|
|
b7c707bd4e | ||
|
|
b57d2c338c | ||
|
|
28069fc84b | ||
|
|
d7ec62cdbe | ||
|
|
244fc7acaa | ||
|
|
3716330ac7 |
10
README.md
10
README.md
@@ -1,4 +1,4 @@
|
||||
# Salvium One v1.1.0
|
||||
# Salvium One v1.1.1
|
||||
|
||||
Copyright (c) 2023-2025, Salvium
|
||||
Portions Copyright (c) 2014-2023, The Monero Project
|
||||
@@ -172,7 +172,7 @@ invokes cmake commands as needed.
|
||||
|
||||
```bash
|
||||
cd salvium
|
||||
git checkout v1.1.0
|
||||
git checkout v1.1.1
|
||||
make
|
||||
```
|
||||
|
||||
@@ -251,7 +251,7 @@ Tested on a Raspberry Pi Zero with a clean install of minimal Raspbian Stretch (
|
||||
```bash
|
||||
git clone https://github.com/salvium/salvium
|
||||
cd salvium
|
||||
git checkout v1.1.0
|
||||
git checkout v1.1.1
|
||||
```
|
||||
|
||||
* Build:
|
||||
@@ -370,10 +370,10 @@ application.
|
||||
cd salvium
|
||||
```
|
||||
|
||||
* If you would like a specific [version/tag](https://github.com/salvium/salvium/tags), do a git checkout for that version. eg. 'v1.1.0'. If you don't care about the version and just want binaries from master, skip this step:
|
||||
* If you would like a specific [version/tag](https://github.com/salvium/salvium/tags), do a git checkout for that version. eg. 'v1.1.1'. If you don't care about the version and just want binaries from master, skip this step:
|
||||
|
||||
```bash
|
||||
git checkout v1.1.0
|
||||
git checkout v1.1.1
|
||||
```
|
||||
|
||||
* If you are on a 64-bit system, run:
|
||||
|
||||
@@ -6,7 +6,7 @@ macro(CHECK_LINKER_FLAG flag VARIABLE)
|
||||
message(STATUS "Looking for ${flag} linker flag")
|
||||
endif()
|
||||
|
||||
set(_cle_source ${CMAKE_SOURCE_DIR}/cmake/CheckLinkerFlag.c)
|
||||
set(_cle_source ${CMAKE_CURRENT_SOURCE_DIR}/cmake/CheckLinkerFlag.c)
|
||||
|
||||
set(saved_CMAKE_C_FLAGS ${CMAKE_C_FLAGS})
|
||||
set(CMAKE_C_FLAGS "${flag}")
|
||||
|
||||
5
salvium-v1.1.0-hashes.txt
Normal file
5
salvium-v1.1.0-hashes.txt
Normal file
@@ -0,0 +1,5 @@
|
||||
e032e42ebac862bf90d71f0a231d9f3ddb5583e321ec153ee05144d87629980b salvium-v1.1.0-macos-aarch64.zip
|
||||
0f31f09cf7be38b50a35510172bc94b7a4fb07c7107c79c4f055754c282c99f5 salvium-v1.1.0-macos-x86_64.zip
|
||||
4424fd93391daab7eee47c54ab7aad7810a16f4c866209d41ba016d984605ffb salvium-v1.1.0-ubuntu22.04-linux-aarch64.zip
|
||||
d1a5138f892189dfccc1d51d72ce24147fe6f1a2a5d465d350651426a71282a4 salvium-v1.1.0-ubuntu22.04-linux-x86_64.zip
|
||||
bb9c9175726b82e061a6a332a27a6845805be4779928df3abbbd5c0f54691c9a salvium-v1.1.0-win64.zip
|
||||
5
salvium-v1.1.1-hashes.txt
Normal file
5
salvium-v1.1.1-hashes.txt
Normal file
@@ -0,0 +1,5 @@
|
||||
d22bbe19fa5e7eb7ebaf95eee336d73cbd59ded7b5e737213e89a8b84d5791eb salvium-v1.1.1-macos-aarch64.zip
|
||||
262e2bdffc3c4fee89ec79451a6181175671db5874726d359077c4479754076e salvium-v1.1.1-macos-x86_64.zip
|
||||
72b37fa30df6b136dba380b88e9ccc4d66804d8286a221a87e944e337f4ba593 salvium-v1.1.1-ubuntu22.04-linux-aarch64.zip
|
||||
33321419bb426507de0f5de7c1977e436ca34bf4db620fa00eede1fa318b7994 salvium-v1.1.1-ubuntu22.04-linux-x86_64.zip
|
||||
33e7c1e1bc4e5a1f9c40482eba993a5efb97a8feedfb36dca863bbb5bd9e794f salvium-v1.1.1-win64.zip
|
||||
@@ -2060,6 +2060,7 @@ bool Blockchain::create_block_template(block& b, const crypto::hash *from_block,
|
||||
expected_reward = m_btc_expected_reward;
|
||||
seed_height = m_btc_seed_height;
|
||||
seed_hash = m_btc_seed_hash;
|
||||
miner_reward_tx_key = m_btc_miner_reward_tx_key;
|
||||
return true;
|
||||
}
|
||||
MDEBUG("Not using cached template: address " << (!memcmp(&miner_address, &m_btc_address, sizeof(cryptonote::account_public_address))) << ", nonce " << (m_btc_nonce == ex_nonce) << ", cookie " << (m_btc_pool_cookie == m_tx_pool.cookie()) << ", from_block " << (!!from_block));
|
||||
@@ -2493,7 +2494,7 @@ bool Blockchain::create_block_template(block& b, const crypto::hash *from_block,
|
||||
#endif
|
||||
|
||||
if (!from_block)
|
||||
cache_block_template(b, miner_address, ex_nonce, diffic, height, expected_reward, seed_height, seed_hash, pool_cookie);
|
||||
cache_block_template(b, miner_address, ex_nonce, diffic, height, expected_reward, seed_height, seed_hash, pool_cookie, miner_reward_tx_key);
|
||||
return true;
|
||||
}
|
||||
LOG_ERROR("Failed to create_block_template with " << 10 << " tries");
|
||||
@@ -7084,7 +7085,7 @@ void Blockchain::invalidate_block_template_cache()
|
||||
m_btc_valid = false;
|
||||
}
|
||||
|
||||
void Blockchain::cache_block_template(const block &b, const cryptonote::account_public_address &address, const blobdata &nonce, const difficulty_type &diff, uint64_t height, uint64_t expected_reward, uint64_t seed_height, const crypto::hash &seed_hash, uint64_t pool_cookie)
|
||||
void Blockchain::cache_block_template(const block &b, const cryptonote::account_public_address &address, const blobdata &nonce, const difficulty_type &diff, uint64_t height, uint64_t expected_reward, uint64_t seed_height, const crypto::hash &seed_hash, uint64_t pool_cookie, crypto::public_key &miner_reward_tx_key)
|
||||
{
|
||||
MDEBUG("Setting block template cache");
|
||||
m_btc = b;
|
||||
@@ -7096,6 +7097,7 @@ void Blockchain::cache_block_template(const block &b, const cryptonote::account_
|
||||
m_btc_seed_hash = seed_hash;
|
||||
m_btc_seed_height = seed_height;
|
||||
m_btc_pool_cookie = pool_cookie;
|
||||
m_btc_miner_reward_tx_key = miner_reward_tx_key;
|
||||
m_btc_valid = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -1333,7 +1333,7 @@ namespace cryptonote
|
||||
crypto::hash m_btc_seed_hash;
|
||||
uint64_t m_btc_seed_height;
|
||||
bool m_btc_valid;
|
||||
|
||||
crypto::public_key m_btc_miner_reward_tx_key;
|
||||
|
||||
bool m_batch_success;
|
||||
|
||||
@@ -1759,7 +1759,7 @@ namespace cryptonote
|
||||
*
|
||||
* At some point, may be used to push an update to miners
|
||||
*/
|
||||
void cache_block_template(const block &b, const cryptonote::account_public_address &address, const blobdata &nonce, const difficulty_type &diff, uint64_t height, uint64_t expected_reward, uint64_t seed_height, const crypto::hash &seed_hash, uint64_t pool_cookie);
|
||||
void cache_block_template(const block &b, const cryptonote::account_public_address &address, const blobdata &nonce, const difficulty_type &diff, uint64_t height, uint64_t expected_reward, uint64_t seed_height, const crypto::hash &seed_hash, uint64_t pool_cookie, crypto::public_key &miner_reward_tx_key);
|
||||
|
||||
/**
|
||||
* @brief sends new block notifications to ZMQ `miner_data` subscribers
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#define DEF_SALVIUM_VERSION_TAG "@VERSIONTAG@"
|
||||
#define DEF_SALVIUM_VERSION "1.1.0"
|
||||
#define DEF_SALVIUM_VERSION "1.1.1"
|
||||
#define DEF_MONERO_VERSION_TAG "release"
|
||||
#define DEF_MONERO_VERSION "0.18.4.0"
|
||||
#define DEF_MONERO_RELEASE_NAME "One"
|
||||
|
||||
@@ -34,16 +34,60 @@
|
||||
#include "wallet.h"
|
||||
|
||||
#include "crypto/hash.h"
|
||||
#include "cryptonote_basic/cryptonote_format_utils.h"
|
||||
#include "wallet/wallet2.h"
|
||||
|
||||
|
||||
#include <string>
|
||||
#include <list>
|
||||
#include <unordered_map>
|
||||
#include <unordered_set>
|
||||
|
||||
using namespace epee;
|
||||
|
||||
namespace Monero {
|
||||
|
||||
namespace {
|
||||
|
||||
std::string to_hex_or_empty(const crypto::public_key &key)
|
||||
{
|
||||
if (key == crypto::null_pkey)
|
||||
return {};
|
||||
return string_tools::pod_to_hex(key);
|
||||
}
|
||||
|
||||
std::vector<std::string> extract_return_addresses(const cryptonote::transaction_prefix &tx)
|
||||
{
|
||||
std::vector<std::string> addresses;
|
||||
if (tx.type == cryptonote::transaction_type::STAKE)
|
||||
{
|
||||
auto hex = to_hex_or_empty(tx.protocol_tx_data.return_address);
|
||||
if (hex.empty())
|
||||
hex = to_hex_or_empty(tx.return_address);
|
||||
if (!hex.empty())
|
||||
addresses.push_back(hex);
|
||||
return addresses;
|
||||
}
|
||||
if (tx.type != cryptonote::transaction_type::PROTOCOL)
|
||||
return addresses;
|
||||
|
||||
std::unordered_set<std::string> seen;
|
||||
for (const auto &out : tx.vout)
|
||||
{
|
||||
crypto::public_key output_key = crypto::null_pkey;
|
||||
if (!cryptonote::get_output_public_key(out, output_key))
|
||||
continue;
|
||||
auto hex = to_hex_or_empty(output_key);
|
||||
if (hex.empty())
|
||||
continue;
|
||||
if (seen.emplace(hex).second)
|
||||
addresses.push_back(hex);
|
||||
}
|
||||
return addresses;
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
TransactionHistory::~TransactionHistory() {}
|
||||
|
||||
|
||||
@@ -130,6 +174,7 @@ void TransactionHistoryImpl::refresh()
|
||||
|
||||
std::list<std::pair<crypto::hash, tools::wallet2::payment_details>> in_payments;
|
||||
m_wallet->m_wallet->get_payments(in_payments, min_height, max_height);
|
||||
std::unordered_map<crypto::hash, TransactionInfoImpl*> protocol_by_hash;
|
||||
for (std::list<std::pair<crypto::hash, tools::wallet2::payment_details>>::const_iterator i = in_payments.begin(); i != in_payments.end(); ++i) {
|
||||
const tools::wallet2::payment_details &pd = i->second;
|
||||
std::string payment_id = string_tools::pod_to_hex(i->first);
|
||||
@@ -152,6 +197,8 @@ void TransactionHistoryImpl::refresh()
|
||||
ti->m_unlock_time = pd.m_unlock_time;
|
||||
ti->m_type = static_cast<Monero::transaction_type>(static_cast<uint8_t>(pd.m_tx_type));
|
||||
ti->m_asset = pd.m_asset_type;
|
||||
if (pd.m_tx_type == cryptonote::transaction_type::PROTOCOL)
|
||||
protocol_by_hash.emplace(pd.m_tx_hash, ti);
|
||||
m_history.push_back(ti);
|
||||
|
||||
}
|
||||
@@ -178,7 +225,8 @@ void TransactionHistoryImpl::refresh()
|
||||
uint64_t amount = pd.m_amount_in - change - fee;
|
||||
if (pd.m_tx.type == cryptonote::transaction_type::AUDIT ||
|
||||
pd.m_tx.type == cryptonote::transaction_type::BURN ||
|
||||
pd.m_tx.type == cryptonote::transaction_type::STAKE) {
|
||||
pd.m_tx.type == cryptonote::transaction_type::STAKE ||
|
||||
pd.m_tx.type == cryptonote::transaction_type::ROLLUP) {
|
||||
amount = pd.m_tx.amount_burnt;
|
||||
if (fee > amount) fee -= amount;
|
||||
}
|
||||
@@ -203,6 +251,7 @@ void TransactionHistoryImpl::refresh()
|
||||
ti->m_confirmations = (wallet_height > pd.m_block_height) ? wallet_height - pd.m_block_height : 0;
|
||||
ti->m_type = static_cast<Monero::transaction_type>(static_cast<uint8_t>(pd.m_tx.type));
|
||||
ti->m_asset = pd.m_tx.source_asset_type;
|
||||
ti->m_return_addresses = extract_return_addresses(pd.m_tx);
|
||||
|
||||
// single output transaction might contain multiple transfers
|
||||
for (const auto &d: pd.m_dests) {
|
||||
@@ -223,7 +272,8 @@ void TransactionHistoryImpl::refresh()
|
||||
uint64_t amount = pd.m_amount_in - change - fee;
|
||||
if (pd.m_tx.type == cryptonote::transaction_type::AUDIT ||
|
||||
pd.m_tx.type == cryptonote::transaction_type::BURN ||
|
||||
pd.m_tx.type == cryptonote::transaction_type::STAKE) {
|
||||
pd.m_tx.type == cryptonote::transaction_type::STAKE ||
|
||||
pd.m_tx.type == cryptonote::transaction_type::ROLLUP) {
|
||||
amount = pd.m_tx.amount_burnt;
|
||||
if (fee > amount) fee -= amount;
|
||||
}
|
||||
@@ -249,6 +299,7 @@ void TransactionHistoryImpl::refresh()
|
||||
ti->m_confirmations = 0;
|
||||
ti->m_type = static_cast<Monero::transaction_type>(static_cast<uint8_t>(pd.m_tx.type));
|
||||
ti->m_asset = pd.m_tx.source_asset_type;
|
||||
ti->m_return_addresses = extract_return_addresses(pd.m_tx);
|
||||
for (const auto &d : pd.m_dests)
|
||||
{
|
||||
ti->m_transfers.push_back({d.amount, d.address(m_wallet->m_wallet->nettype(), pd.m_payment_id), d.asset_type});
|
||||
@@ -280,11 +331,23 @@ void TransactionHistoryImpl::refresh()
|
||||
ti->m_confirmations = 0;
|
||||
ti->m_type = static_cast<Monero::transaction_type>(static_cast<uint8_t>(pd.m_tx_type));
|
||||
ti->m_asset = pd.m_asset_type;
|
||||
if (pd.m_tx_type == cryptonote::transaction_type::PROTOCOL)
|
||||
protocol_by_hash.emplace(pd.m_tx_hash, ti);
|
||||
m_history.push_back(ti);
|
||||
|
||||
LOG_PRINT_L1(__FUNCTION__ << ": Unconfirmed payment found " << pd.m_amount);
|
||||
}
|
||||
|
||||
|
||||
std::list<std::pair<crypto::hash, tools::wallet2::confirmed_transfer_details>> confirmed_protocol_payments;
|
||||
m_wallet->m_wallet->get_payments_out(confirmed_protocol_payments, min_height, max_height);
|
||||
for (const auto &entry : confirmed_protocol_payments)
|
||||
{
|
||||
const auto it = protocol_by_hash.find(entry.first);
|
||||
if (it == protocol_by_hash.end())
|
||||
continue;
|
||||
it->second->m_return_addresses = extract_return_addresses(entry.second.m_tx);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
@@ -134,6 +134,11 @@ string TransactionInfoImpl::paymentId() const
|
||||
return m_paymentid;
|
||||
}
|
||||
|
||||
const std::vector<std::string> &TransactionInfoImpl::returnAddresses() const
|
||||
{
|
||||
return m_return_addresses;
|
||||
}
|
||||
|
||||
const std::vector<TransactionInfo::Transfer> &TransactionInfoImpl::transfers() const
|
||||
{
|
||||
return m_transfers;
|
||||
|
||||
@@ -60,6 +60,7 @@ public:
|
||||
virtual std::string hash() const override;
|
||||
virtual std::time_t timestamp() const override;
|
||||
virtual std::string paymentId() const override;
|
||||
virtual const std::vector<std::string> &returnAddresses() const override;
|
||||
virtual const std::vector<Transfer> &transfers() const override;
|
||||
virtual uint64_t confirmations() const override;
|
||||
virtual uint64_t unlockTime() const override;
|
||||
@@ -81,6 +82,7 @@ private:
|
||||
std::string m_hash;
|
||||
std::time_t m_timestamp;
|
||||
std::string m_paymentid;
|
||||
std::vector<std::string> m_return_addresses;
|
||||
std::vector<Transfer> m_transfers;
|
||||
uint64_t m_confirmations;
|
||||
uint64_t m_unlock_time;
|
||||
|
||||
@@ -806,6 +806,16 @@ std::string WalletImpl::seed(const std::string& seed_offset) const
|
||||
return std::string(seed.data(), seed.size()); // TODO
|
||||
}
|
||||
|
||||
void WalletImpl::setStoreTxInfo(bool store)
|
||||
{
|
||||
m_wallet->store_tx_info(store);
|
||||
}
|
||||
|
||||
bool WalletImpl::storeTxInfo() const
|
||||
{
|
||||
return m_wallet->store_tx_info();
|
||||
}
|
||||
|
||||
std::string WalletImpl::getSeedLanguage() const
|
||||
{
|
||||
return m_wallet->get_seed_language();
|
||||
|
||||
@@ -83,6 +83,8 @@ public:
|
||||
Device getDeviceType() const override;
|
||||
bool close(bool store = true);
|
||||
std::string seed(const std::string& seed_offset = "") const override;
|
||||
void setStoreTxInfo(bool store) override;
|
||||
bool storeTxInfo() const override;
|
||||
std::string getSeedLanguage() const override;
|
||||
void setSeedLanguage(const std::string &arg) override;
|
||||
// void setListener(Listener *) {}
|
||||
|
||||
@@ -236,6 +236,7 @@ struct TransactionInfo
|
||||
virtual std::string hash() const = 0;
|
||||
virtual std::time_t timestamp() const = 0;
|
||||
virtual std::string paymentId() const = 0;
|
||||
virtual const std::vector<std::string> & returnAddresses() const = 0;
|
||||
//! only applicable for output transactions
|
||||
virtual const std::vector<Transfer> & transfers() const = 0;
|
||||
virtual Monero::transaction_type type() const = 0;
|
||||
@@ -503,6 +504,8 @@ struct Wallet
|
||||
|
||||
virtual ~Wallet() = 0;
|
||||
virtual std::string seed(const std::string& seed_offset = "") const = 0;
|
||||
virtual void setStoreTxInfo(bool store) = 0;
|
||||
virtual bool storeTxInfo() const = 0;
|
||||
virtual std::string getSeedLanguage() const = 0;
|
||||
virtual void setSeedLanguage(const std::string &arg) = 0;
|
||||
//! returns wallet status (Status_Ok | Status_Error)
|
||||
|
||||
Reference in New Issue
Block a user