mirror of
https://github.com/wownero/lwsf-wow.git
synced 2026-10-17 07:21:28 +02:00
Add support for from_height in /import_wallet_request
This commit is contained in:
+1
-1
@@ -1303,7 +1303,7 @@ namespace lwsf { namespace internal { namespace backend
|
|||||||
}
|
}
|
||||||
|
|
||||||
// current api does not allow height selection, defaults to 0
|
// current api does not allow height selection, defaults to 0
|
||||||
rpc::login login{primary.address, primary.view.sec};
|
rpc::import_request login{{primary.address, primary.view.sec}, height};
|
||||||
|
|
||||||
lock.unlock();
|
lock.unlock();
|
||||||
auto import = rpc::invoke<rpc::import_response>(client, login);
|
auto import = rpc::invoke<rpc::import_response>(client, login);
|
||||||
|
|||||||
@@ -433,6 +433,15 @@ namespace lwsf { namespace internal { namespace rpc
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void write_bytes(wire::json_writer& source, const import_request& self)
|
||||||
|
{
|
||||||
|
wire::object(source,
|
||||||
|
wire::field("address", std::cref(self.creds.address)),
|
||||||
|
wire::field("view_key", std::cref(self.creds.view_key)),
|
||||||
|
WIRE_FIELD(from_height)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
void read_bytes(wire::json_reader& source, import_response& self)
|
void read_bytes(wire::json_reader& source, import_response& self)
|
||||||
{
|
{
|
||||||
wire::object(source,
|
wire::object(source,
|
||||||
|
|||||||
@@ -378,6 +378,14 @@ namespace lwsf { namespace internal { namespace rpc
|
|||||||
void read_bytes(wire::json_reader&, get_unspent_outs_response&);
|
void read_bytes(wire::json_reader&, get_unspent_outs_response&);
|
||||||
|
|
||||||
|
|
||||||
|
struct import_request
|
||||||
|
{
|
||||||
|
import_request() = delete;
|
||||||
|
login creds;
|
||||||
|
std::uint64_t from_height;
|
||||||
|
};
|
||||||
|
void write_bytes(wire::json_writer&, const import_request&);
|
||||||
|
|
||||||
struct import_response
|
struct import_response
|
||||||
{
|
{
|
||||||
import_response() = delete;
|
import_response() = delete;
|
||||||
|
|||||||
Reference in New Issue
Block a user