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

Create ReservedUtxoService #2

Merged
merged 19 commits into from
Aug 24, 2020
Merged

Create ReservedUtxoService #2

merged 19 commits into from
Aug 24, 2020

Conversation

fassadlr
Copy link
Contributor

ICoin[] spentCoins = context.TransactionBuilder.FindSpentCoins(transaction);

// Here we reserve the UTXO OutPoint so that it cant be selected again.
if (spentCoins.Any())
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@zeptin not sure if this should be done here. Perhaps closer to where SC transaction is created?

Copy link
Collaborator

Choose a reason for hiding this comment

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

I guess this is fine for now, although it is a few layers down from the controller itself.

I suppose the principle of least surprise here is that creating multiple transactions in succession should 'just work' - if it relies on the reservation under the hood then that is acceptable.

{
foreach (var outPoint in outPoints)
{
if (!this.reservedCoins.Contains(outPoint))
Copy link
Collaborator

Choose a reason for hiding this comment

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

Technically you only need to do this check to make the log entry accurate, adding regardless is harmless

@zeptin zeptin merged commit b4ca030 into stratisproject:master Aug 24, 2020
@fassadlr fassadlr deleted the fix-inputs-with-sc branch August 24, 2020 07:15
fassadlr pushed a commit that referenced this pull request Nov 3, 2020
fassadlr added a commit that referenced this pull request Nov 18, 2020
* Fixes

* Remove Keys
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.

Mempool Conflict With Multiple Txs in Same Block
2 participants