mirror of
https://github.com/darkrenaissance/darkfi.git
synced 2026-01-10 07:08:05 -05:00
mmproxy/monero: Implement generateblocks RPC
This commit is contained in:
@@ -171,9 +171,9 @@ impl RequestHandler for MiningProxy {
|
||||
"getblocktemplate" => self.monero_get_block_template(req.id, req.params).await,
|
||||
"submit_block" => self.monero_submit_block(req.id, req.params).await,
|
||||
"submitblock" => self.monero_submit_block(req.id, req.params).await,
|
||||
"generateblocks" => self.monero_generateblocks(req.id, req.params).await,
|
||||
|
||||
/*
|
||||
"generateblocks" => self.monero_generateblocks(req.id, req.params).await,
|
||||
"get_last_block_header" => self.monero_get_last_block_header(req.id, req.params).await,
|
||||
"get_block_header_by_hash" => self.monero_get_block_header_by_hash(req.id, req.params).await,
|
||||
"get_block_header_by_height" => self.monero_get_block_header_by_height(req.id, req.params).await,
|
||||
|
||||
@@ -256,11 +256,25 @@ impl MiningProxy {
|
||||
JsonResponse::new(rep, id).into()
|
||||
}
|
||||
|
||||
/*
|
||||
/// Generate a block and specify the address to receive the coinbase reward.
|
||||
/// <https://www.getmonero.org/resources/developer-guides/daemon-rpc.html#generateblocks>
|
||||
pub async fn monero_generateblocks(&self, id: u16, params: JsonValue) -> JsonResult {
|
||||
todo!()
|
||||
debug!(target: "rpc::monero", "generateblocks()");
|
||||
|
||||
// This request can just passthrough
|
||||
let req = JsonRequest::new("generateblocks", params);
|
||||
let rep = match self.oneshot_request(req).await {
|
||||
Ok(v) => v,
|
||||
Err(e) => {
|
||||
error!(target: "rpc::monero::generateblocks", "[RPC] {}", e);
|
||||
return JsonError::new(InternalError, Some(e.to_string()), id).into()
|
||||
}
|
||||
};
|
||||
|
||||
JsonResponse::new(rep, id).into()
|
||||
}
|
||||
|
||||
/*
|
||||
pub async fn monero_get_last_block_header(&self, id: u16, params: JsonValue) -> JsonResult {
|
||||
todo!()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user