From 9bdd985ceef0c3a3220fcc9e5d8b5bd6b487c152 Mon Sep 17 00:00:00 2001 From: rbrunner7 Date: Thu, 31 Aug 2017 10:11:20 +0200 Subject: monero-wallet-cli: New command 'wallet_info' --- src/simplewallet/simplewallet.cpp | 11 +++++++++++ src/simplewallet/simplewallet.h | 1 + 2 files changed, 12 insertions(+) diff --git a/src/simplewallet/simplewallet.cpp b/src/simplewallet/simplewallet.cpp index 479adcafc..e69a7aa1b 100644 --- a/src/simplewallet/simplewallet.cpp +++ b/src/simplewallet/simplewallet.cpp @@ -713,6 +713,7 @@ simple_wallet::simple_wallet() m_cmd_binder.set_handler("set_tx_note", boost::bind(&simple_wallet::set_tx_note, this, _1), tr("Set an arbitrary string note for a txid")); m_cmd_binder.set_handler("get_tx_note", boost::bind(&simple_wallet::get_tx_note, this, _1), tr("Get a string note for a txid")); m_cmd_binder.set_handler("status", boost::bind(&simple_wallet::status, this, _1), tr("Show wallet status information")); + m_cmd_binder.set_handler("wallet_info", boost::bind(&simple_wallet::wallet_info, this, _1), tr("Show wallet information")); m_cmd_binder.set_handler("sign", boost::bind(&simple_wallet::sign, this, _1), tr("Sign the contents of a file")); m_cmd_binder.set_handler("verify", boost::bind(&simple_wallet::verify, this, _1), tr("Verify a signature on the contents of a file")); m_cmd_binder.set_handler("export_key_images", boost::bind(&simple_wallet::export_key_images, this, _1), tr("Export a signed set of key images")); @@ -4443,6 +4444,16 @@ bool simple_wallet::status(const std::vector &args) return true; } //---------------------------------------------------------------------------------------------------- +bool simple_wallet::wallet_info(const std::vector &args) +{ + success_msg_writer() << "Filename: " << m_wallet->get_wallet_file(); + success_msg_writer() << "Address: " << m_wallet->get_account().get_public_address_str(m_wallet->testnet()); + success_msg_writer() << "Watch only: " << (m_wallet->watch_only() ? "Yes" : "No"); + success_msg_writer() << "Restricted RPC: " << (m_wallet->restricted() ? "Yes" : "No"); + success_msg_writer() << "Testnet: " << (m_wallet->testnet() ? "Yes" : "No"); + return true; +} +//---------------------------------------------------------------------------------------------------- bool simple_wallet::sign(const std::vector &args) { if (args.size() != 1) diff --git a/src/simplewallet/simplewallet.h b/src/simplewallet/simplewallet.h index eac4cbc99..b8bd9924e 100644 --- a/src/simplewallet/simplewallet.h +++ b/src/simplewallet/simplewallet.h @@ -165,6 +165,7 @@ namespace cryptonote bool set_tx_note(const std::vector &args); bool get_tx_note(const std::vector &args); bool status(const std::vector &args); + bool wallet_info(const std::vector &args); bool set_default_priority(const std::vector &args); bool sign(const std::vector &args); bool verify(const std::vector &args); -- cgit v1.2.3 From 840aed1cf3c0a0171e0090b9dfbc72a02209d417 Mon Sep 17 00:00:00 2001 From: rbrunner7 Date: Thu, 31 Aug 2017 18:01:15 +0200 Subject: monero-wallet-cli: New command 'wallet_info' improved --- src/simplewallet/simplewallet.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/simplewallet/simplewallet.cpp b/src/simplewallet/simplewallet.cpp index e69a7aa1b..3cfb89949 100644 --- a/src/simplewallet/simplewallet.cpp +++ b/src/simplewallet/simplewallet.cpp @@ -4446,11 +4446,10 @@ bool simple_wallet::status(const std::vector &args) //---------------------------------------------------------------------------------------------------- bool simple_wallet::wallet_info(const std::vector &args) { - success_msg_writer() << "Filename: " << m_wallet->get_wallet_file(); - success_msg_writer() << "Address: " << m_wallet->get_account().get_public_address_str(m_wallet->testnet()); - success_msg_writer() << "Watch only: " << (m_wallet->watch_only() ? "Yes" : "No"); - success_msg_writer() << "Restricted RPC: " << (m_wallet->restricted() ? "Yes" : "No"); - success_msg_writer() << "Testnet: " << (m_wallet->testnet() ? "Yes" : "No"); + message_writer() << tr("Filename: ") << m_wallet->get_wallet_file(); + message_writer() << tr("Address: ") << m_wallet->get_account().get_public_address_str(m_wallet->testnet()); + message_writer() << tr("Watch only: ") << (m_wallet->watch_only() ? tr("Yes") : tr("No")); + message_writer() << tr("Testnet: ") << (m_wallet->testnet() ? tr("Yes") : tr("No")); return true; } //---------------------------------------------------------------------------------------------------- -- cgit v1.2.3