mirror of
https://github.com/wownero/wownero-cpp.git
synced 2026-10-17 15:21:30 +02:00
rename send_split() to send_txs()
This commit is contained in:
+10
-10
@@ -945,8 +945,8 @@ namespace monero {
|
||||
* @param request configures the transaction
|
||||
* @return a tx set with the requested transaction if possible
|
||||
*/
|
||||
virtual monero_tx_set send(const monero_send_request& request) {
|
||||
throw runtime_error("send() not supported");
|
||||
virtual monero_tx_set send_tx(const monero_send_request& request) {
|
||||
throw runtime_error("send_tx() not supported");
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -958,8 +958,8 @@ namespace monero {
|
||||
* @param amount is the amount being sent
|
||||
* @return a tx set with the requested transaction if possible
|
||||
*/
|
||||
virtual monero_tx_set send(uint32_t account_index, string address, uint64_t amount) {
|
||||
throw runtime_error("send() not supported");
|
||||
virtual monero_tx_set send_tx(uint32_t account_index, string address, uint64_t amount) {
|
||||
throw runtime_error("send_tx() not supported");
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -972,8 +972,8 @@ namespace monero {
|
||||
* @param priority is the send priority (default normal)
|
||||
* @return a tx set with the requested transaction if possible
|
||||
*/
|
||||
virtual monero_tx_set send(uint32_t account_index, string address, uint64_t amount, monero_send_priority priority) {
|
||||
throw runtime_error("send() not supported");
|
||||
virtual monero_tx_set send_tx(uint32_t account_index, string address, uint64_t amount, monero_send_priority priority) {
|
||||
throw runtime_error("send_tx() not supported");
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -983,8 +983,8 @@ namespace monero {
|
||||
* @param request configures the transaction
|
||||
* @return a tx set with the requested transactions if possible
|
||||
*/
|
||||
virtual monero_tx_set send_split(const monero_send_request& request) {
|
||||
throw runtime_error("send_split() not supported");
|
||||
virtual monero_tx_set send_txs(const monero_send_request& request) {
|
||||
throw runtime_error("send_txs() not supported");
|
||||
}
|
||||
|
||||
// /**
|
||||
@@ -996,7 +996,7 @@ namespace monero {
|
||||
// * @param sendAmount is the amount being sent
|
||||
// * @return the resulting transactions
|
||||
// */
|
||||
// public List<monero_tx_wallet> send_split(int account_index, string address, BigInteger sendAmount);
|
||||
// public List<monero_tx_wallet> send_txs(int account_index, string address, BigInteger sendAmount);
|
||||
//
|
||||
// /**
|
||||
// * Create and relay one or more transactions which transfer funds from this
|
||||
@@ -1008,7 +1008,7 @@ namespace monero {
|
||||
// * @param priority is the send priority (default normal)
|
||||
// * @return the resulting transactions
|
||||
// */
|
||||
// public List<monero_tx_wallet> send_split(int account_index, string address, BigInteger sendAmount, monero_send_priority priority);
|
||||
// public List<monero_tx_wallet> send_txs(int account_index, string address, BigInteger sendAmount, monero_send_priority priority);
|
||||
|
||||
/**
|
||||
* Sweep unlocked funds according to the given request.
|
||||
|
||||
@@ -1776,7 +1776,7 @@ namespace monero {
|
||||
request.m_do_not_relay = true;
|
||||
|
||||
// invoke common method which doesn't relay
|
||||
monero_tx_set tx_set = send_split(request);
|
||||
monero_tx_set tx_set = send_txs(request);
|
||||
|
||||
// restore doNotRelay of request and txs
|
||||
request.m_do_not_relay = requested_do_not_relay;
|
||||
@@ -1840,27 +1840,27 @@ namespace monero {
|
||||
return relay_txs(tx_hexes);
|
||||
}
|
||||
|
||||
monero_tx_set monero_wallet_core::send(const monero_send_request& request) {
|
||||
if (request.m_can_split != boost::none && request.m_can_split.get()) throw runtime_error("Cannot request split transactions with send() which prevents splitting; use sendSplit() instead");
|
||||
monero_tx_set monero_wallet_core::send_tx(const monero_send_request& request) {
|
||||
if (request.m_can_split != boost::none && request.m_can_split.get()) throw runtime_error("Cannot request split transactions with send_tx() which prevents splitting; use sendSplit() instead");
|
||||
monero_send_request copy = request.copy();
|
||||
copy.m_can_split = false;
|
||||
return send_split(copy);
|
||||
return send_txs(copy);
|
||||
}
|
||||
|
||||
monero_tx_set monero_wallet_core::send(uint32_t account_index, string address, uint64_t amount) {
|
||||
return send(account_index, address, amount, monero_send_priority::NORMAL);
|
||||
monero_tx_set monero_wallet_core::send_tx(uint32_t account_index, string address, uint64_t amount) {
|
||||
return send_tx(account_index, address, amount, monero_send_priority::NORMAL);
|
||||
}
|
||||
|
||||
monero_tx_set monero_wallet_core::send(uint32_t account_index, string address, uint64_t amount, monero_send_priority priority) {
|
||||
monero_tx_set monero_wallet_core::send_tx(uint32_t account_index, string address, uint64_t amount, monero_send_priority priority) {
|
||||
monero_send_request req;
|
||||
req.m_account_index = account_index;
|
||||
req.m_destinations.push_back(make_shared<monero_destination>(address, amount));
|
||||
req.m_priority = priority;
|
||||
return send(req);
|
||||
return send_tx(req);
|
||||
}
|
||||
|
||||
monero_tx_set monero_wallet_core::send_split(const monero_send_request& request) {
|
||||
MTRACE("monero_wallet_core::send_split(request)");
|
||||
monero_tx_set monero_wallet_core::send_txs(const monero_send_request& request) {
|
||||
MTRACE("monero_wallet_core::send_txs(request)");
|
||||
MTRACE("monero_send_request: " << request.serialize());
|
||||
|
||||
// validate request
|
||||
@@ -1898,7 +1898,7 @@ namespace monero {
|
||||
|
||||
// check if request cannot be fulfilled due to splitting
|
||||
if (request.m_can_split != boost::none && request.m_can_split.get() == false && ptx_vector.size() != 1) {
|
||||
throw runtime_error("Transaction would be too large. Try send_split()");
|
||||
throw runtime_error("Transaction would be too large. Try send_txs()");
|
||||
}
|
||||
|
||||
// config for fill_response()
|
||||
@@ -2214,7 +2214,7 @@ namespace monero {
|
||||
throw runtime_error("need to handle error filling response!"); // TODO: return err message
|
||||
}
|
||||
|
||||
// build sent txs from results // TODO: use common utility with send_split() to avoid code duplication
|
||||
// build sent txs from results // TODO: use common utility with send_txs() to avoid code duplication
|
||||
vector<shared_ptr<monero_tx_wallet>> txs;
|
||||
auto tx_hashes_iter = tx_hashes.begin();
|
||||
auto tx_keys_iter = tx_keys.begin();
|
||||
@@ -2301,7 +2301,7 @@ namespace monero {
|
||||
throw runtime_error("need to handle error filling response!"); // TODO: return err message
|
||||
}
|
||||
|
||||
// build sent txs from results // TODO: use common utility with send_split() to avoid code duplication
|
||||
// build sent txs from results // TODO: use common utility with send_txs() to avoid code duplication
|
||||
vector<shared_ptr<monero_tx_wallet>> txs;
|
||||
auto tx_hashes_iter = tx_hashes.begin();
|
||||
auto tx_keys_iter = tx_keys.begin();
|
||||
|
||||
@@ -237,10 +237,10 @@ namespace monero {
|
||||
string relay_tx(const monero_tx_wallet& tx);
|
||||
vector<string> relay_txs(const vector<string>& tx_metadatas);
|
||||
vector<string> relay_txs(const vector<shared_ptr<monero_tx_wallet>>& txs);
|
||||
monero_tx_set send(const monero_send_request& request);
|
||||
monero_tx_set send(uint32_t account_index, string address, uint64_t amount);
|
||||
monero_tx_set send(uint32_t account_index, string address, uint64_t amount, monero_send_priority priority);
|
||||
monero_tx_set send_split(const monero_send_request& request);
|
||||
monero_tx_set send_tx(const monero_send_request& request);
|
||||
monero_tx_set send_tx(uint32_t account_index, string address, uint64_t amount);
|
||||
monero_tx_set send_tx(uint32_t account_index, string address, uint64_t amount, monero_send_priority priority);
|
||||
monero_tx_set send_txs(const monero_send_request& request);
|
||||
vector<monero_tx_set> sweep_unlocked(const monero_send_request& request);
|
||||
monero_tx_set sweep_output(const monero_send_request& request);
|
||||
monero_tx_set sweep_dust(bool do_not_relay = false);
|
||||
|
||||
@@ -297,7 +297,7 @@ namespace monero {
|
||||
* Groups transactions who share common hex data which is needed in order to
|
||||
* sign and submit the transactions.
|
||||
*
|
||||
* For example, multisig transactions created from send_split() share a common
|
||||
* For example, multisig transactions created from send_txs() share a common
|
||||
* hex string which is needed in order to sign and submit the multisig
|
||||
* transactions.
|
||||
*/
|
||||
|
||||
@@ -100,7 +100,7 @@ int main(int argc, const char* argv[]) {
|
||||
wallet_random->add_listener(my_listener);
|
||||
|
||||
// send funds from the restored wallet to the random wallet
|
||||
shared_ptr<monero_tx_wallet> sent_tx = wallet_restored->send(0, wallet_random->get_address(1, 0), 50000).m_txs[0];
|
||||
shared_ptr<monero_tx_wallet> sent_tx = wallet_restored->send_tx(0, wallet_random->get_address(1, 0), 50000).m_txs[0];
|
||||
bool in_pool = sent_tx->m_in_tx_pool.get(); // true
|
||||
|
||||
// mine with 7 threads to push the network along
|
||||
|
||||
Reference in New Issue
Block a user