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

Wallet: CLN errors for invoices with description hash #786

Closed
5 tasks
callebtc opened this issue Jul 26, 2022 · 1 comment
Closed
5 tasks

Wallet: CLN errors for invoices with description hash #786

callebtc opened this issue Jul 26, 2022 · 1 comment
Assignees
Labels
bug Something isn't working wallets Funding sources

Comments

@callebtc
Copy link
Collaborator

callebtc commented Jul 26, 2022

Right now creating a CLN invoice with description hash uses a plugin invoicewithdescriptionhash.

New CLN supports description hash out of the box (see here):

From here:

def invoice(self, amount_msat=None, label=None, description=None, expiry=None, fallbacks=None,
      preimage=None, exposeprivatechannels=None, cltv=None, deschashonly=None, msatoshi=None):

Let's use it.

Need to remove this block from clightning.py

# check description_hash support (could be provided by a plugin)
        self.supports_description_hash = False
        try:
            answer = self.ln.help("invoicewithdescriptionhash")
            if answer["help"][0]["command"].startswith(
                "invoicewithdescriptionhash msatoshi label description_hash"
            ):
                self.supports_description_hash = True
        except:
            pass

Maybe this is also a good opportunity to rename the wallet to cln.py (see if old versions can still import it though).

Todo:

  • Update pylightning to pyln-client
  • Update wallet documentation where pylightning is referenced
  • Get rid of supports_description_hash block
  • Rename clightning.py to cln.py?
  • Write tests with description hash that should fail with old version
@callebtc callebtc added bug Something isn't working wallets Funding sources labels Jul 26, 2022
@callebtc callebtc self-assigned this Jul 26, 2022
@callebtc
Copy link
Collaborator Author

Fixed in #792.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working wallets Funding sources
Projects
None yet
Development

No branches or pull requests

1 participant