Skip to content

Commit 3a009b6

Browse files
committed
fixed block_id parameter parsing
1 parent ed0a085 commit 3a009b6

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

stackslib/src/net/api/blockreplay.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -359,6 +359,7 @@ impl HttpRequest for RPCNakamotoBlockReplayRequestHandler {
359359

360360
let block_id = StacksBlockId::from_hex(block_id_str)
361361
.map_err(|_| Error::DecodeError("Invalid path: unparseable block id".to_string()))?;
362+
362363
self.block_id = Some(block_id);
363364

364365
Ok(HttpRequestContents::new().query_string(query))
@@ -378,10 +379,9 @@ impl RPCRequestHandler for RPCNakamotoBlockReplayRequestHandler {
378379
_contents: HttpRequestContents,
379380
node: &mut StacksNodeState,
380381
) -> Result<(HttpResponsePreamble, HttpResponseContents), NetError> {
381-
let block_id = self
382-
.block_id
383-
.take()
384-
.ok_or(NetError::SendError("Missing `block_id`".into()))?;
382+
let Some(block_id) = &self.block_id else {
383+
return Err(NetError::SendError("Missing `block_id`".into()));
384+
};
385385

386386
let replayed_block_res =
387387
node.with_node_state(|_network, sortdb, chainstate, _mempool, _rpc_args| {

0 commit comments

Comments
 (0)