Skip to content
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 TransactionLocation in DefaultBlockchain unsafeImportBlock() #7956

Merged
merged 4 commits into from
Nov 29, 2024

Conversation

pinges
Copy link
Contributor

@pinges pinges commented Nov 28, 2024

PR description

Fix the TransactionLocation in unsafeImportBlock()

fixes #7955

…make some readability improvements

Signed-off-by: stefan.pingel@consensys.net <stefan.pingel@consensys.net>
for (int i = 0; i < nbTrx; i++) {
final Hash transactionHash = block.getBody().getTransactions().get(i).getHash();
updater.putTransactionLocation(transactionHash, new TransactionLocation(transactionHash, i));
for (int index = 0; index < nbTrx; index++) {
Copy link
Contributor

Choose a reason for hiding this comment

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

The indexTransactionForBlock could be used here to remove some duplicated code

pinges and others added 2 commits November 29, 2024 09:43
Signed-off-by: stefan.pingel@consensys.net <stefan.pingel@consensys.net>
@pinges pinges enabled auto-merge (squash) November 28, 2024 23:44
Copy link
Contributor

@jframe jframe left a comment

Choose a reason for hiding this comment

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

LGTM

@pinges pinges merged commit 8a033b9 into hyperledger:main Nov 29, 2024
43 checks passed
@pinges pinges deleted the fixTxIndex branch December 2, 2024 05:29
ahamlat pushed a commit to ahamlat/besu that referenced this pull request Dec 2, 2024
…erledger#7956)

* fix TransactionLocation in DefaultBlockchain unsafeImportBlock() and make some readability improvements

Signed-off-by: stefan.pingel@consensys.net <stefan.pingel@consensys.net>
Signed-off-by: Ameziane H. <ameziane.hamlat@consensys.net>
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.

TransactionLocation uses transaction hash instead of block hash
3 participants