diff options
author | Neozaru <neozaru@mailoo.org> | 2014-06-02 00:22:42 +0200 |
---|---|---|
committer | Neozaru <neozaru@mailoo.org> | 2014-06-02 00:22:42 +0200 |
commit | 117393d562fc9782efed0e1b25f6470d9f8102b2 (patch) | |
tree | 64bda474a67cbc24cea03fdfca9aaf7a2ab8fadb /src/simplewallet/simplewallet.cpp | |
parent | Merge bitmonero@monero-project (diff) | |
download | monero-117393d562fc9782efed0e1b25f6470d9f8102b2.tar.xz |
Added 'payment_id' optional argument to 'transfer' wallet RPC method
Diffstat (limited to 'src/simplewallet/simplewallet.cpp')
-rw-r--r-- | src/simplewallet/simplewallet.cpp | 17 |
1 files changed, 2 insertions, 15 deletions
diff --git a/src/simplewallet/simplewallet.cpp b/src/simplewallet/simplewallet.cpp index dc45d9d74..4cab12c22 100644 --- a/src/simplewallet/simplewallet.cpp +++ b/src/simplewallet/simplewallet.cpp @@ -64,19 +64,6 @@ namespace return err; } - bool parse_payment_id(const std::string& payment_id_str, crypto::hash& payment_id) - { - blobdata payment_id_data; - if(!string_tools::parse_hexstr_to_binbuff(payment_id_str, payment_id_data)) - return false; - - if(sizeof(crypto::hash) != payment_id_data.size()) - return false; - - payment_id = *reinterpret_cast<const crypto::hash*>(payment_id_data.data()); - return true; - } - class message_writer { public: @@ -680,7 +667,7 @@ bool simple_wallet::show_payments(const std::vector<std::string> &args) for(std::string arg : args) { crypto::hash payment_id; - if(parse_payment_id(arg, payment_id)) + if(tools::wallet2::parse_payment_id(arg, payment_id)) { std::list<tools::wallet2::payment_details> payments; m_wallet->get_payments(payment_id, payments); @@ -763,7 +750,7 @@ bool simple_wallet::transfer(const std::vector<std::string> &args_) local_args.pop_back(); crypto::hash payment_id; - bool r = parse_payment_id(payment_id_str, payment_id); + bool r = tools::wallet2::parse_payment_id(payment_id_str, payment_id); if(r) { std::string extra_nonce; |