Skip to content
This repository has been archived by the owner on Nov 2, 2018. It is now read-only.

New data structure for miner transactions #2689

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

Conversation

ChrisSchinnerl
Copy link
Contributor

This PR is a suggestion for a data structure that might help us avoid reordering transactions within the block after removing a transaction. It's essentially a double linked list.
Looking up a transaction by id, inserting a transaction and removing a transaction should all happen in constant time. After we are done modifying the transactions a call to transactions returns a slice.
Since the miner already has to go through all the transactions once before solving the block, looping over the transactions one more time to get the slice shouldn't impact performance.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant