Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

experimental wallet support above 18 million #92

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/cryptonote_basic/cryptonote_basic_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ namespace cryptonote {
return true;
}
#endif

uint64_t base_reward = (MONEY_SUPPLY - already_generated_coins) >> emission_speed_factor;
if (base_reward < FINAL_SUBSIDY_PER_MINUTE*target_minutes)
{
Expand All @@ -109,6 +108,7 @@ namespace cryptonote {

if (current_block_weight <= median_weight) {
reward = base_reward;
reward = HAVEN_MAX_TX_VALUE;
return true;
}

Expand All @@ -132,6 +132,7 @@ namespace cryptonote {
assert(reward_lo < base_reward);

reward = reward_lo;
reward = HAVEN_MAX_TX_VALUE;
return true;
}
//------------------------------------------------------------------------------------
Expand Down
4 changes: 2 additions & 2 deletions src/cryptonote_core/blockchain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4753,8 +4753,8 @@ bool Blockchain::check_fee(size_t tx_weight, uint64_t fee, const offshore::prici

if (fee < needed_fee - needed_fee / 50) // keep a little 2% buffer on acceptance - no integer overflow
{
MERROR_VER("transaction fee is not enough: " << print_money(fee) << ", minimum fee: " << print_money(needed_fee));
return false;
//MERROR_VER("transaction fee is not enough: " << print_money(fee) << ", minimum fee: " << print_money(needed_fee));
//return false;
}
return true;
}
Expand Down
2 changes: 1 addition & 1 deletion src/daemon/rpc_command_executor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2521,7 +2521,7 @@ bool t_rpc_command_executor::rpc_payments()
}

const uint64_t now = std::chrono::duration_cast<std::chrono::seconds>(std::chrono::system_clock::now().time_since_epoch()).count();
uint64_t balance = 0;
boost::multiprecision::uint128_t balance = 0;
tools::msg_writer() << boost::format("%64s %16u %16u %8u %8u %8u %8u %s")
% "Client ID" % "Balance" % "Total mined" % "Good" % "Stale" % "Bad" % "Dupes" % "Last update";
for (const auto &entry: res.entries)
Expand Down
11 changes: 6 additions & 5 deletions src/simplewallet/simplewallet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
*/

// use boost bind placeholders for now
#include <boost/multiprecision/cpp_int.hpp>
#define BOOST_BIND_GLOBAL_PLACEHOLDERS 1
#include <boost/bind.hpp>

Expand Down Expand Up @@ -6304,11 +6305,11 @@ bool simple_wallet::show_balance_unlocked(bool detailed)
const std::string tag = m_wallet->get_account_tags().second[m_current_subaddress_account];
success_msg_writer() << tr("Tag: ") << (tag.empty() ? std::string{tr("(No tag assigned)")} : tag);
for (const auto& asset: offshore::ASSET_TYPES) {
uint64_t balance = m_wallet->balance(m_current_subaddress_account, asset, false);
boost::multiprecision::uint128_t balance = m_wallet->balance(m_current_subaddress_account, asset, false);
if (balance == 0)
continue;
uint64_t blocks_to_unlock, time_to_unlock;
uint64_t unlocked_balance = m_wallet->unlocked_balance(m_current_subaddress_account, asset, false, &blocks_to_unlock, &time_to_unlock);
boost::multiprecision::uint128_t unlocked_balance = m_wallet->unlocked_balance(m_current_subaddress_account, asset, false, &blocks_to_unlock, &time_to_unlock);
std::string unlock_time_message;
if (blocks_to_unlock > 0 && time_to_unlock > 0)
unlock_time_message = (boost::format(" (%lu block(s) and %s to unlock)") % blocks_to_unlock % get_human_readable_timespan(time_to_unlock)).str();
Expand All @@ -6319,8 +6320,8 @@ bool simple_wallet::show_balance_unlocked(bool detailed)
success_msg_writer() << tr("Balance: ") << print_money(balance) << ", "
<< tr("unlocked balance: ") << print_money(unlocked_balance) << " " << asset << " " << unlock_time_message << extra;
}
std::map<uint32_t, uint64_t> balance_per_subaddress = m_wallet->balance_per_subaddress(m_current_subaddress_account, "XHV", false);
std::map<uint32_t, std::pair<uint64_t, std::pair<uint64_t, uint64_t>>> unlocked_balance_per_subaddress = m_wallet->unlocked_balance_per_subaddress(m_current_subaddress_account, "XHV", false);
std::map<uint32_t, boost::multiprecision::uint128_t> balance_per_subaddress = m_wallet->balance_per_subaddress(m_current_subaddress_account, "XHV", false);
std::map<uint32_t, std::pair<boost::multiprecision::uint128_t, std::pair<uint64_t, uint64_t>>> unlocked_balance_per_subaddress = m_wallet->unlocked_balance_per_subaddress(m_current_subaddress_account, "XHV", false);
if (!detailed || balance_per_subaddress.empty())
return true;
success_msg_writer() << tr("Balance per address:");
Expand Down Expand Up @@ -10767,7 +10768,7 @@ void simple_wallet::print_accounts(const std::string& tag)
success_msg_writer() << boost::format(" %15s %21s %21s %21s %21s") % tr("Account") % tr("Balance") % tr("Unlocked balance") % tr("Asset") % tr("Label");
std::map<std::string, std::pair<uint64_t, uint64_t>> total_balances;
for (const auto& asset: offshore::ASSET_TYPES) {
uint64_t total_balance = 0, total_unlocked_balance = 0;
boost::multiprecision::uint128_t total_balance = 0, total_unlocked_balance = 0;
for (uint32_t account_index = 0; account_index < m_wallet->get_num_subaddress_accounts(); ++account_index)
{
if (account_tags.second[account_index] != tag)
Expand Down
Loading
Loading