aboutsummaryrefslogtreecommitdiff
path: root/src/model/block.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/model/block.rs')
-rw-r--r--src/model/block.rs8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/model/block.rs b/src/model/block.rs
index 6df8e265..1173c7b3 100644
--- a/src/model/block.rs
+++ b/src/model/block.rs
@@ -594,10 +594,8 @@ impl BlockManager {
need_nodes.push(*node);
}
}
- _ => {
- return Err(Error::Message(
- "Unexpected response to NeedBlockQuery RPC".to_string(),
- ));
+ m => {
+ return Err(Error::unexpected_rpc_message(m));
}
}
}
@@ -730,7 +728,7 @@ impl EndpointHandler<BlockRpc> for BlockManager {
BlockRpc::PutBlock { hash, data } => self.write_block(hash, data).await,
BlockRpc::GetBlock(h) => self.read_block(h).await,
BlockRpc::NeedBlockQuery(h) => self.need_block(h).await.map(BlockRpc::NeedBlockReply),
- _ => Err(Error::BadRpc("Unexpected RPC message".to_string())),
+ m => Err(Error::unexpected_rpc_message(m)),
}
}
}