Skip to content

Commit

Permalink
Include transaction date with timestamp in show_transfers
Browse files Browse the repository at this point in the history
  • Loading branch information
miltonf committed Feb 13, 2019
1 parent 67bac37 commit 40f051b
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/simplewallet/simplewallet.cpp
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -6054,10 +6054,7 @@ static std::string get_human_readable_timestamp(uint64_t ts)
#endif #endif
uint64_t now = time(NULL); uint64_t now = time(NULL);
uint64_t diff = ts > now ? ts - now : now - ts; uint64_t diff = ts > now ? ts - now : now - ts;
if (diff > 24*3600) strftime(buffer, sizeof(buffer), "%Y-%m-%d %H:%M:%S", &tm);
strftime(buffer, sizeof(buffer), "%Y-%m-%d", &tm);
else
strftime(buffer, sizeof(buffer), "%I:%M:%S %p", &tm);
return std::string(buffer); return std::string(buffer);
} }
//---------------------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------------------
Expand Down Expand Up @@ -6169,7 +6166,7 @@ bool simple_wallet::show_transfers(const std::vector<std::string> &args_)
if (payment_id.substr(16).find_first_not_of('0') == std::string::npos) if (payment_id.substr(16).find_first_not_of('0') == std::string::npos)
payment_id = payment_id.substr(0,16); payment_id = payment_id.substr(0,16);
std::string note = m_wallet->get_tx_note(pd.m_tx_hash); std::string note = m_wallet->get_tx_note(pd.m_tx_hash);
output.insert(std::make_pair(pd.m_block_height, std::make_pair(true, (boost::format("%16.16s %20.20s %s %s %d %s %s") % get_human_readable_timestamp(pd.m_timestamp) % print_money(pd.m_amount) % string_tools::pod_to_hex(pd.m_tx_hash) % payment_id % pd.m_subaddr_index.minor % "-" % note).str()))); output.insert(std::make_pair(pd.m_block_height, std::make_pair(true, (boost::format("%25.25s %20.20s %s %s %d %s %s") % get_human_readable_timestamp(pd.m_timestamp) % print_money(pd.m_amount) % string_tools::pod_to_hex(pd.m_tx_hash) % payment_id % pd.m_subaddr_index.minor % "-" % note).str())));
} }
} }


Expand Down

0 comments on commit 40f051b

Please sign in to comment.