aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/wallet_errors.h
diff options
context:
space:
mode:
authorRiccardo Spagni <ric@spagni.net>2014-09-15 16:42:50 +0200
committerRiccardo Spagni <ric@spagni.net>2014-09-15 16:46:21 +0200
commit83276bf92d44c1aa1b6acbd9879f70e806f12af6 (patch)
treef37e154c5fd9e7f8b2295e3e3a1091f8670b52b7 /src/wallet/wallet_errors.h
parentincrease ABSTRACT_SERVER_SEND_QUE_MAX_COUNT to a more sane value (diff)
parentfixed incorrect version reference (diff)
downloadmonero-83276bf92d44c1aa1b6acbd9879f70e806f12af6.tar.xz
Merge pull request #139
72a80f6 fixed incorrect version reference (Riccardo Spagni) 95a2701 Change testnet prefix (Zachary Michaels) 120c84d Make P2P use the testnet data dir (Zachary Michaels) 2352565 Replace macro with equivalent function call (Zachary Michaels) d033087 Separate testnet address prefix (Zachary Michaels) ee1bacc Add testnet seed nodes (Zachary Michaels) 4a6eb0a Create testnet data dir if necessary (Zachary Michaels) 018e251 Separate testnet default data dir (Zachary Michaels) 3ef7f33 Add descriptions for RPC command line params (Zachary Michaels) 1e38a02 Add testnet genesis tx as output by CN reference (Zachary Michaels) 96eed84 Pass tx and nonce to genesis block constructor (Zachary Michaels) 257077a Separate network id for testnet (Zachary Michaels) 658b669 Separate rpc port for testnet (Zachary Michaels) 98ed9a4 Separate p2p port for testnet (Zachary Michaels) fb4146f Reorganize testnet constants (Zachary Michaels) 79862ad Add testnet constants (Zachary Michaels) 07470fd Add testnet flag (Zachary Michaels) 32004a7 increase ABSTRACT_SERVER_SEND_QUE_MAX_COUNT to a more sane value (Riccardo Spagni) 2c0a87f additional README info on static builds and FreeBSD (Riccardo Spagni)
Diffstat (limited to 'src/wallet/wallet_errors.h')
-rw-r--r--src/wallet/wallet_errors.h37
1 files changed, 26 insertions, 11 deletions
diff --git a/src/wallet/wallet_errors.h b/src/wallet/wallet_errors.h
index aa29f281a..7914ff8e1 100644
--- a/src/wallet/wallet_errors.h
+++ b/src/wallet/wallet_errors.h
@@ -376,11 +376,18 @@ namespace tools
typedef std::vector<cryptonote::tx_source_entry> sources_t;
typedef std::vector<cryptonote::tx_destination_entry> destinations_t;
- explicit tx_not_constructed(std::string&& loc, const sources_t& sources, const destinations_t& destinations, uint64_t unlock_time)
- : transfer_error(std::move(loc), "transaction was not constructed")
- , m_sources(sources)
- , m_destinations(destinations)
- , m_unlock_time(unlock_time)
+ explicit tx_not_constructed(
+ std::string && loc
+ , sources_t const & sources
+ , destinations_t const & destinations
+ , uint64_t unlock_time
+ , bool testnet
+ )
+ : transfer_error {std::move(loc), "transaction was not constructed"}
+ , m_sources {sources}
+ , m_destinations {destinations}
+ , m_unlock_time {unlock_time}
+ , m_testnet {testnet}
{
}
@@ -414,7 +421,7 @@ namespace tools
for (size_t i = 0; i < m_destinations.size(); ++i)
{
const cryptonote::tx_destination_entry& dst = m_destinations[i];
- ss << "\n " << i << ": " << cryptonote::get_account_address_as_str(dst.addr) << " " <<
+ ss << "\n " << i << ": " << cryptonote::get_account_address_as_str(m_testnet, dst.addr) << " " <<
cryptonote::print_money(dst.amount);
}
@@ -427,6 +434,7 @@ namespace tools
sources_t m_sources;
destinations_t m_destinations;
uint64_t m_unlock_time;
+ bool m_testnet;
};
//----------------------------------------------------------------------------------------------------
struct tx_rejected : public transfer_error
@@ -457,10 +465,16 @@ namespace tools
//----------------------------------------------------------------------------------------------------
struct tx_sum_overflow : public transfer_error
{
- explicit tx_sum_overflow(std::string&& loc, const std::vector<cryptonote::tx_destination_entry>& destinations, uint64_t fee)
- : transfer_error(std::move(loc), "transaction sum + fee exceeds " + cryptonote::print_money(std::numeric_limits<uint64_t>::max()))
- , m_destinations(destinations)
- , m_fee(fee)
+ explicit tx_sum_overflow(
+ std::string && loc
+ , const std::vector<cryptonote::tx_destination_entry>& destinations
+ , uint64_t fee
+ , bool testnet
+ )
+ : transfer_error {std::move(loc), "transaction sum + fee exceeds " + cryptonote::print_money(std::numeric_limits<uint64_t>::max())}
+ , m_destinations {destinations}
+ , m_fee {fee}
+ , m_testnet {testnet}
{
}
@@ -475,7 +489,7 @@ namespace tools
", destinations:";
for (const auto& dst : m_destinations)
{
- ss << '\n' << cryptonote::print_money(dst.amount) << " -> " << cryptonote::get_account_address_as_str(dst.addr);
+ ss << '\n' << cryptonote::print_money(dst.amount) << " -> " << cryptonote::get_account_address_as_str(m_testnet, dst.addr);
}
return ss.str();
}
@@ -483,6 +497,7 @@ namespace tools
private:
std::vector<cryptonote::tx_destination_entry> m_destinations;
uint64_t m_fee;
+ bool m_testnet;
};
//----------------------------------------------------------------------------------------------------
struct tx_too_big : public transfer_error