-
Notifications
You must be signed in to change notification settings - Fork 55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix #378: Add blockhash parameter into gettxproof command #379
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for taking this, I have some comments thought.
Tip: the fixes
thing only works with the syntax fixes #XXX
, the way you made it GH won't link the issue
) -> Result<Vec<String>, RpcError> { | ||
if let Some(hash) = block_hash { | ||
let block = self.get_block(hash).await?; | ||
return Ok(vec![block |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This returns the transaction, not the merkle proof for it as this method should
@@ -297,8 +297,15 @@ async fn handle_json_rpc_request(req: Value, state: Arc<RpcImpl>) -> Result<serd | |||
"gettxoutproof" => { | |||
let txid = Txid::from_str(params[0].as_str().ok_or(Error::InvalidHash)?) | |||
.map_err(|_| Error::InvalidHash)?; | |||
let blockhash = match params[1].as_str() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is easier to try parse and return error if it fails, like we do with txid
What is the purpose of this pull request?
Fix the issue #378
Which crates are being modified?
Description
Add missing
block_hash
parameter intoget_tx_proof
function and check if transaction is included in the block.