forked from lthn/blockchain
fixes for wallet, implemented proxy-rpc for UI
This commit is contained in:
parent
e6168a813a
commit
0716e84529
5 changed files with 36 additions and 12 deletions
|
|
@ -269,7 +269,28 @@ QString MainWindow::request_dummy()
|
|||
CATCH_ENTRY_FAIL_API_RESPONCE();
|
||||
}
|
||||
|
||||
QString MainWindow::call_rpc(const QString& params)
|
||||
{
|
||||
TRY_ENTRY();
|
||||
epee::net_utils::http::http_request_info query_info = AUTO_VAL_INIT(query_info);
|
||||
epee::net_utils::http::http_response_info response_info = AUTO_VAL_INIT(response_info);
|
||||
currency::core_rpc_server::connection_context dummy_context = AUTO_VAL_INIT(dummy_context);
|
||||
|
||||
query_info.m_URI = "/json_rpc";
|
||||
query_info.m_body = params.toStdString();
|
||||
|
||||
m_backend.get_rpc_server().handle_http_request(query_info, response_info, dummy_context);
|
||||
if (response_info.m_response_code != 200)
|
||||
{
|
||||
epee::json_rpc::error_response rsp;
|
||||
rsp.jsonrpc = "2.0";
|
||||
rsp.error.code = response_info.m_response_code;
|
||||
rsp.error.message = response_info.m_response_comment;
|
||||
return QString::fromStdString(epee::serialization::store_t_to_json(static_cast<epee::json_rpc::error_response&>(rsp)));
|
||||
}
|
||||
return QString::fromStdString(response_info.m_body);
|
||||
CATCH_ENTRY_FAIL_API_RESPONCE();
|
||||
}
|
||||
QString MainWindow::get_default_fee()
|
||||
{
|
||||
TRY_ENTRY();
|
||||
|
|
|
|||
|
|
@ -195,6 +195,8 @@ public:
|
|||
//for test purposes onlys
|
||||
QString request_dummy();
|
||||
|
||||
QString MainWindow::call_rpc(const QString& params);
|
||||
|
||||
signals:
|
||||
void quit_requested(const QString str);
|
||||
void update_daemon_state(const QString str);
|
||||
|
|
|
|||
|
|
@ -5381,9 +5381,9 @@ bool wallet2::build_ionic_swap_template(const wallet_public::ionic_swap_proposal
|
|||
ctp.mark_tx_as_complete = false;
|
||||
ctp.crypt_address = destination_addr;
|
||||
|
||||
etc_tx_details_expiration_time t = AUTO_VAL_INIT(t);
|
||||
t.v = proposal_detais.expiration_time;
|
||||
ctp.extra.push_back(t);
|
||||
//etc_tx_details_expiration_time t = AUTO_VAL_INIT(t);
|
||||
//t.v = 0;//proposal_detais.expiration_time;
|
||||
//ctp.extra.push_back(t);
|
||||
|
||||
ctp.dsts.resize(proposal_detais.to_bob.size() + proposal_detais.to_alice.size());
|
||||
size_t i = 0;
|
||||
|
|
@ -5416,7 +5416,7 @@ bool wallet2::build_ionic_swap_template(const wallet_public::ionic_swap_proposal
|
|||
selected_transfers = ftp.selected_transfers;
|
||||
currency::finalized_tx finalize_result = AUTO_VAL_INIT(finalize_result);
|
||||
finalize_transaction(ftp, finalize_result, false);
|
||||
add_transfers_to_expiration_list(selected_transfers, for_expiration_list, this->get_core_runtime_config().get_core_time() + proposal_detais.expiration_time, currency::null_hash);
|
||||
//add_transfers_to_expiration_list(selected_transfers, for_expiration_list, this->get_core_runtime_config().get_core_time() + proposal_detais.expiration_time, currency::null_hash);
|
||||
|
||||
//wrap it all
|
||||
proposal.tx_template = finalize_result.tx;
|
||||
|
|
@ -5572,13 +5572,13 @@ bool wallet2::get_ionic_swap_proposal_info(const wallet_public::ionic_swap_propo
|
|||
proposal_info.to_alice.push_back(view::asset_funds{ a.first, a.second - amounts_provided_by_a[a.first] });
|
||||
}
|
||||
|
||||
etc_tx_details_expiration_time t = AUTO_VAL_INIT(t);
|
||||
if (!get_type_in_variant_container(tx.extra, t))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
//etc_tx_details_expiration_time t = AUTO_VAL_INIT(t);
|
||||
//if (!get_type_in_variant_container(tx.extra, t))
|
||||
//{
|
||||
// return false;
|
||||
//}
|
||||
|
||||
proposal_info.expiration_time = t.v;
|
||||
//proposal_info.expiration_time = t.v;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1327,7 +1327,7 @@ namespace wallet_public
|
|||
std::vector<asset_funds> to_alice; //assets expected to be funded by the side that receiving proposal (Bob) and addressed to Alice
|
||||
uint64_t mixins;
|
||||
uint64_t fee_paid_by_a;
|
||||
uint64_t expiration_time;
|
||||
//uint64_t expiration_time;
|
||||
|
||||
BEGIN_KV_SERIALIZE_MAP()
|
||||
|
||||
|
|
@ -1335,7 +1335,7 @@ namespace wallet_public
|
|||
KV_SERIALIZE(to_alice)
|
||||
KV_SERIALIZE(mixins)
|
||||
KV_SERIALIZE(fee_paid_by_a)
|
||||
KV_SERIALIZE(expiration_time)
|
||||
//KV_SERIALIZE(expiration_time)
|
||||
END_KV_SERIALIZE_MAP()
|
||||
|
||||
};
|
||||
|
|
|
|||
|
|
@ -144,6 +144,7 @@ public:
|
|||
std::string get_fav_offers(const std::list<bc_services::offer_id>& hashes, const bc_services::core_offers_filter& filter, std::list<bc_services::offer_details_ex>& offers);
|
||||
std::string get_tx_pool_info(currency::COMMAND_RPC_GET_POOL_INFO::response& res);
|
||||
std::string export_wallet_history(const view::export_wallet_info& ewi);
|
||||
currency::core_rpc_server& get_rpc_server() { return m_rpc_server; }
|
||||
uint64_t get_default_fee();
|
||||
std::string get_mining_estimate(uint64_t amuont_coins,
|
||||
uint64_t time,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue