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

Passing description_hash without description to createHodlInvoice does not set the invoice description_hash #147

Open
steliosrammos opened this issue Sep 11, 2023 · 5 comments

Comments

@steliosrammos
Copy link

This does not set the description_hash:.

 const invoice = await createHodlInvoice({
        lnd,
        id: '540c398ff10942d362386c648d0b6f918df1fe596c6953873779b6cdf71c4f25',
        description_hash: 'd97653a83596a42e369ceed4e480609f51377e1befa8c65852adecbc0cfca0e6',
        tokens: 10000,
    });

This would set the description_hash to d97653a83596a42e369ceed4e480609f51377e1befa8c65852adecbc0cfca0e6, although it is not the sha256() of test.

 const invoice = await createHodlInvoice({
        lnd,
        id: '540c398ff10942d362386c648d0b6f918df1fe596c6953873779b6cdf71c4f25',
        description: 'test',
        description_hash: 'd97653a83596a42e369ceed4e480609f51377e1befa8c65852adecbc0cfca0e6',
        tokens: 10000,
    });

Expected Behaviour

  1. The first segment would set the description_hash to d97653a83596a42e369ceed4e480609f51377e1befa8c65852adecbc0cfca0e6
  2. The second segment would throw an error (?)
@alexbosworth
Copy link
Owner

LND doesn't let you set both, it will silently drop one

@alexbosworth
Copy link
Owner

Hmm hold invoice I thought it was regular, I can take a look

@alexbosworth
Copy link
Owner

ok yeah it looks like it works the same, this is an LND behavior when you pass both

@steliosrammos
Copy link
Author

What about the first case where only the description_hash is passed, without a description?

@alexbosworth
Copy link
Owner

Yeah that works

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

No branches or pull requests

2 participants