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

Payjoin: Better UIH1 & UIH2 based selection #1473

Merged

Conversation

Kukks
Copy link
Member

@Kukks Kukks commented Apr 18, 2020

closes #1470

I need to add some tests.

@Kukks Kukks force-pushed the payjoin/better-utxo-selection branch from 00195df to d2b7995 Compare April 27, 2020 09:09
@Kukks Kukks marked this pull request as ready for review April 27, 2020 09:09
@Kukks Kukks force-pushed the payjoin/better-utxo-selection branch from cfcd8b0 to d359c98 Compare April 27, 2020 11:29
psbt.Outputs.Where(o => o.Index != output.Index).Select(o => o.Value).ToArray()))

foreach (var utxo in (await SelectUTXO(network, utxos, psbt.Inputs.Select(input => input.WitnessUtxo.Value.ToDecimal(MoneyUnit.BTC)), output.Value.ToDecimal(MoneyUnit.BTC),
psbt.Outputs.Where(psbtOutput => psbtOutput != output).Select(psbtOutput => psbtOutput.Value.ToDecimal(MoneyUnit.BTC)))).selectedUTXO)
Copy link
Member

Choose a reason for hiding this comment

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

why do you even change this? psbtOutput => psbtOutput != output

Copy link
Member Author

Choose a reason for hiding this comment

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

the params separate the payment output from the others to compute what the modified payment output value will be

Copy link
Member

Choose a reason for hiding this comment

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

I know but before I was comparing the index, why did you modified to compare the object?

Copy link
Member Author

Choose a reason for hiding this comment

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

ah, no clue why. Does it make a difference?

Copy link
Member Author

Choose a reason for hiding this comment

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

reverted back t yours

Copy link
Member

Choose a reason for hiding this comment

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

I don't think so, but I had a doubt that I override the .Equals (which was a bad idea), I prefer not touching what does not break.

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.

Improve Payjoin utxo selector
2 participants