mirror of
https://codeberg.org/anoncontributorxmr/monero.git
synced 2024-11-27 05:13:25 +01:00
rpc: add a do_not_relay boolean to tx submission
Just to make it easier
This commit is contained in:
parent
e7c8a32a28
commit
5c9dd23b1c
@ -383,7 +383,7 @@ namespace cryptonote
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!tvc.m_should_be_relayed)
|
if(!tvc.m_should_be_relayed || req.do_not_relay)
|
||||||
{
|
{
|
||||||
LOG_PRINT_L0("[on_send_raw_tx]: tx accepted, but not relayed");
|
LOG_PRINT_L0("[on_send_raw_tx]: tx accepted, but not relayed");
|
||||||
res.reason = "Not relayed";
|
res.reason = "Not relayed";
|
||||||
|
@ -221,12 +221,14 @@ namespace cryptonote
|
|||||||
struct request
|
struct request
|
||||||
{
|
{
|
||||||
std::string tx_as_hex;
|
std::string tx_as_hex;
|
||||||
|
bool do_not_relay;
|
||||||
|
|
||||||
request() {}
|
request() {}
|
||||||
explicit request(const transaction &);
|
explicit request(const transaction &);
|
||||||
|
|
||||||
BEGIN_KV_SERIALIZE_MAP()
|
BEGIN_KV_SERIALIZE_MAP()
|
||||||
KV_SERIALIZE(tx_as_hex)
|
KV_SERIALIZE(tx_as_hex)
|
||||||
|
KV_SERIALIZE(do_not_relay)
|
||||||
END_KV_SERIALIZE_MAP()
|
END_KV_SERIALIZE_MAP()
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1974,6 +1974,7 @@ void wallet2::commit_tx(pending_tx& ptx)
|
|||||||
|
|
||||||
COMMAND_RPC_SEND_RAW_TX::request req;
|
COMMAND_RPC_SEND_RAW_TX::request req;
|
||||||
req.tx_as_hex = epee::string_tools::buff_to_hex_nodelimer(tx_to_blob(ptx.tx));
|
req.tx_as_hex = epee::string_tools::buff_to_hex_nodelimer(tx_to_blob(ptx.tx));
|
||||||
|
req.do_not_relay = false;
|
||||||
COMMAND_RPC_SEND_RAW_TX::response daemon_send_resp;
|
COMMAND_RPC_SEND_RAW_TX::response daemon_send_resp;
|
||||||
m_daemon_rpc_mutex.lock();
|
m_daemon_rpc_mutex.lock();
|
||||||
bool r = epee::net_utils::invoke_http_json_remote_command2(m_daemon_address + "/sendrawtransaction", req, daemon_send_resp, m_http_client, 200000);
|
bool r = epee::net_utils::invoke_http_json_remote_command2(m_daemon_address + "/sendrawtransaction", req, daemon_send_resp, m_http_client, 200000);
|
||||||
|
Loading…
Reference in New Issue
Block a user