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

Add extra delete and some comments, also fetch better the last blolck… #106

Merged
merged 1 commit into from
Feb 15, 2022

Conversation

dangershony
Copy link
Member

… query from memory not disk

var utxos = new List<UnspentOutputTable>(storageBatch.OutputTable.Values.Count);

foreach (OutputTable outputTable in storageBatch.OutputTable.Values)
{
if (outputTable.Address.Equals(OpReturnAddress))
continue;

// TODO: filter out outputs that are already spent in the storageBatch.InputTable table
Copy link
Contributor

Choose a reason for hiding this comment

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

This will impact blocks where both the output and input are created

// this is an edge case, we delete from the utxo table in case a bath push failed half way and left
// item in the utxo table that where suppose to get deleted, to avoid duplicates in recovery processes
// we delete just in case (the utxo table has a unique key on outputs), there is no harm in deleting twice.
FilterDefinition<UnspentOutputTable> unspentOutputFilter1 =
Copy link
Contributor

Choose a reason for hiding this comment

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

We can use the same filter on both delete operations

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