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

payalgo: Be willing to overpay up to maxfeepercent, for privacy. #1257

Merged
merged 2 commits into from
Mar 30, 2018

Conversation

ZmnSCPxj
Copy link
Contributor

This obscures how far an intermediate hop is from the ultimate
payee, and also obscures slightly the exact payment value.

Fixes: #1089

@ZmnSCPxj ZmnSCPxj force-pushed the overpay branch 2 times, most recently from 7e85253 to d5a83ee Compare March 22, 2018 13:00
Copy link
Contributor

@rustyrussell rustyrussell left a comment

Choose a reason for hiding this comment

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

Minor neatening would be nice, but it's a nitpick.

/* We will never generate the maximum computed
* overpayment this way. Maybe OK for most
* purposes. */
overpayment = overpayment % maxoverpayment;
Copy link
Contributor

Choose a reason for hiding this comment

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

We have pseudorand for this, which makes this code neater and also indicates we don't need cryptographic randomness. We only use randombytes_buf() above because we don't have a routine to give us a pseudorandom siphash seed, but that would be trivial to implement too.

if (maxoverpayment > 0)
     overpayment = pseudorand(maxoverpayment);
else
    overpayment = 0;

This obscures how far an intermediate hop is from the ultimate
payee, and also obscures slightly the exact payment value.

Fixes: ElementsProject#1089
@ZmnSCPxj
Copy link
Contributor Author

ping!

@cdecker
Copy link
Member

cdecker commented Mar 30, 2018

ACK 1c84a33

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.

3 participants