Skip to content

Added gettxoutproof RPC#160

Merged
dangershony merged 4 commits intoblock-core:masterfrom
x42protocol:Get-TX-Out-Proof
Jun 22, 2020
Merged

Added gettxoutproof RPC#160
dangershony merged 4 commits intoblock-core:masterfrom
x42protocol:Get-TX-Out-Proof

Conversation

@DennisAMenace
Copy link
Copy Markdown
Contributor

Added gettxoutproof RPC (0.20.0 RPC).

Checks if transactions are within block. Returns proof of transaction inclusion (raw MerkleBlock).

}
if (block == null && chainedHeader.BlockDataAvailability == BlockDataAvailabilityState.BlockAvailable) // Only get the block once.
{
block = this.blockStore.GetBlock(chainedHeader.HashBlock);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

aren't you missing a break; here?
Do we assume all trx are of the same block?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally to fetch blocks we should use the ConsensusManager that will fetch from memory first (and it can even download a block if its not available.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

aren't you missing a break; here?
Do we assume all trx are of the same block?

No, we need to check all transactions.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally to fetch blocks we should use the ConsensusManager that will fetch from memory first (and it can even download a block if its not available.

Done. Good to know, thank you.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, we need to check all transactions.

but once you find the block the param is not null and wont be fetched anymore, unless you want to find all the headers and check they are part of the same block

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, we need to check all transactions.

but once you find the block the param is not null and wont be fetched anymore, unless you want to find all the headers and check they are part of the same block

That is correct, I want to verify that they are all in the same block, otherwise, it's not valid proof.

@dangershony dangershony merged commit 7e99384 into block-core:master Jun 22, 2020
@DennisAMenace DennisAMenace deleted the Get-TX-Out-Proof branch June 22, 2020 17:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants