mirror of
https://github.com/wownero/wownero.git
synced 2026-10-22 18:08:34 +02:00
simplewallet: fix show_transfer confirmations
This commit is contained in:
@@ -10117,14 +10117,15 @@ bool simple_wallet::show_transfer(const std::vector<std::string> &args)
|
|||||||
if (pd.m_unlock_time < CRYPTONOTE_MAX_BLOCK_NUMBER)
|
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);
|
uint64_t bh = std::max(pd.m_unlock_time, pd.m_block_height + CRYPTONOTE_DEFAULT_TX_SPENDABLE_AGE);
|
||||||
|
const uint64_t confirmations = last_block_height > pd.m_block_height ? last_block_height - pd.m_block_height : 0;
|
||||||
uint64_t last_block_reward = m_wallet->get_last_block_reward();
|
uint64_t last_block_reward = m_wallet->get_last_block_reward();
|
||||||
uint64_t suggested_threshold = last_block_reward ? (pd.m_amount + last_block_reward - 1) / last_block_reward : 0;
|
uint64_t suggested_threshold = last_block_reward ? (pd.m_amount + last_block_reward - 1) / last_block_reward : 0;
|
||||||
if (bh >= last_block_height)
|
if (bh >= last_block_height)
|
||||||
success_msg_writer() << "Locked: " << (bh - last_block_height) << " blocks to unlock";
|
success_msg_writer() << "Locked: " << (bh - last_block_height) << " blocks to unlock";
|
||||||
else if (suggested_threshold > 0)
|
else if (suggested_threshold > 0)
|
||||||
success_msg_writer() << std::to_string(last_block_height - bh) << " confirmations (" << suggested_threshold << " suggested threshold)";
|
success_msg_writer() << std::to_string(confirmations) << " confirmations (" << suggested_threshold << " suggested threshold)";
|
||||||
else
|
else
|
||||||
success_msg_writer() << std::to_string(last_block_height - bh) << " confirmations";
|
success_msg_writer() << std::to_string(confirmations) << " confirmations";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user