aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorIlya Kitaev <mbg033@gmail.com>2016-06-23 16:23:09 +0300
committerIlya Kitaev <mbg033@gmail.com>2016-06-23 16:23:09 +0300
commitab61ba0c9b9e39fb73a11e4d38dc5c37e453e6c7 (patch)
treea9bf9b3b2b00bb3bf9e0bd467cc55db24255d724 /src
parentWalletManager::findWallets: searching by "keys" files instead of (diff)
parentPendingTransactionImpl: pointer->reference (diff)
downloadmonero-ab61ba0c9b9e39fb73a11e4d38dc5c37e453e6c7.tar.xz
Merge branch 'master' of https://github.com/mbg033/bitmonero
Diffstat (limited to 'src')
-rw-r--r--src/wallet/api/wallet.cpp8
-rw-r--r--src/wallet/wallet2.cpp11
-rw-r--r--src/wallet/wallet2.h2
-rw-r--r--src/wallet/wallet2_api.h4
4 files changed, 13 insertions, 12 deletions
diff --git a/src/wallet/api/wallet.cpp b/src/wallet/api/wallet.cpp
index 354e27ac6..be379cb99 100644
--- a/src/wallet/api/wallet.cpp
+++ b/src/wallet/api/wallet.cpp
@@ -36,7 +36,6 @@
#include "mnemonics/electrum-words.h"
#include <boost/format.hpp>
-#include <boost/regex.hpp>
#include <sstream>
using namespace std;
@@ -146,7 +145,6 @@ std::string Wallet::genPaymentId()
}
-
///////////////////////// WalletImpl implementation ////////////////////////
WalletImpl::WalletImpl(bool testnet)
:m_wallet(nullptr), m_status(Wallet::Status_Ok), m_trustedDaemon(false),
@@ -397,11 +395,13 @@ bool WalletImpl::refresh()
// - payment_details;
// - unconfirmed_transfer_details;
// - confirmed_transfer_details)
+
PendingTransaction *WalletImpl::createTransaction(const string &dst_addr, const string &payment_id, uint64_t amount, uint32_t mixin_count)
{
clearStatus();
vector<cryptonote::tx_destination_entry> dsts;
cryptonote::tx_destination_entry de;
+
// indicates if dst_addr is integrated address (address + payment_id)
bool has_payment_id;
crypto::hash8 payment_id_short;
@@ -420,6 +420,7 @@ PendingTransaction *WalletImpl::createTransaction(const string &dst_addr, const
break;
}
+
std::vector<uint8_t> extra;
// if dst_addr is not an integrated address, parse payment_id
if (!has_payment_id && !payment_id.empty()) {
@@ -446,7 +447,6 @@ PendingTransaction *WalletImpl::createTransaction(const string &dst_addr, const
}
}
-
de.amount = amount;
if (de.amount <= 0) {
m_status = Status_Error;
@@ -457,8 +457,6 @@ PendingTransaction *WalletImpl::createTransaction(const string &dst_addr, const
dsts.push_back(de);
//std::vector<tools::wallet2::pending_tx> ptx_vector;
-
-
try {
transaction->m_pending_tx = m_wallet->create_transactions_2(dsts, fake_outs_count, 0 /* unlock_time */,
0 /* unused fee arg*/, extra, m_trustedDaemon);
diff --git a/src/wallet/wallet2.cpp b/src/wallet/wallet2.cpp
index 4586c3530..02dd59862 100644
--- a/src/wallet/wallet2.cpp
+++ b/src/wallet/wallet2.cpp
@@ -3064,6 +3064,11 @@ std::string wallet2::get_keys_file() const
return m_keys_file;
}
+std::string wallet2::get_daemon_address() const
+{
+ return m_daemon_address;
+}
+
void wallet2::set_tx_note(const crypto::hash &txid, const std::string &note)
{
m_tx_notes[txid] = note;
@@ -3076,12 +3081,6 @@ std::string wallet2::get_tx_note(const crypto::hash &txid) const
return std::string();
return i->second;
}
-
-std::string wallet2::get_daemon_address() const
-{
- return m_daemon_address;
-}
-
//----------------------------------------------------------------------------------------------------
void wallet2::generate_genesis(cryptonote::block& b) {
if (m_testnet)
diff --git a/src/wallet/wallet2.h b/src/wallet/wallet2.h
index 6e49b8dac..85bf33e3f 100644
--- a/src/wallet/wallet2.h
+++ b/src/wallet/wallet2.h
@@ -374,6 +374,7 @@ namespace tools
std::string get_wallet_file() const;
std::string get_keys_file() const;
+ std::string get_daemon_address() const;
std::vector<size_t> select_available_outputs_from_histogram(uint64_t count, bool atleast, bool trusted_daemon);
std::vector<size_t> select_available_outputs(const std::function<bool(const transfer_details &td)> &f);
@@ -383,7 +384,6 @@ namespace tools
void set_tx_note(const crypto::hash &txid, const std::string &note);
std::string get_tx_note(const crypto::hash &txid) const;
- std::string get_daemon_address() const;
private:
/*!
* \brief Stores wallet information to wallet file.
diff --git a/src/wallet/wallet2_api.h b/src/wallet/wallet2_api.h
index c0c3d436a..66987e4c5 100644
--- a/src/wallet/wallet2_api.h
+++ b/src/wallet/wallet2_api.h
@@ -134,6 +134,7 @@ struct Wallet
virtual std::string errorString() const = 0;
virtual bool setPassword(const std::string &password) = 0;
virtual std::string address() const = 0;
+
/*!
* \brief integratedAddress - returns integrated address for current wallet address and given payment_id.
* if passed "payment_id" param is an empty string or not-valid payment id string
@@ -144,6 +145,7 @@ struct Wallet
* \return - 106 characters string representing integrated address
*/
virtual std::string integratedAddress(const std::string &payment_id) const = 0;
+
/*!
* \brief store - stores wallet to file.
* \param path - main filename to store wallet to. additionally stores address file and keys file.
@@ -186,8 +188,10 @@ struct Wallet
* \return PendingTransaction object. caller is responsible to check PendingTransaction::status()
* after object returned
*/
+
virtual PendingTransaction * createTransaction(const std::string &dst_addr, const std::string &payment_id,
uint64_t amount, uint32_t mixin_count) = 0;
+
virtual void disposeTransaction(PendingTransaction * t) = 0;
virtual TransactionHistory * history() const = 0;
virtual void setListener(WalletListener *) = 0;