Closed cryptosharks131 closed 2 years ago
Hi @cryptosharks131! Thanks for opening an issue! Looks like it is a switch statement without a default case: https://github.com/lightningnetwork/lnd/blob/master/rpcserver.go#L1497
Thanks for reporting this! we will fix it asap :)
A workaround for p2tr address generation is to look to see if p2tr is known in the ListAccounts call
Background
When requesting a new address via the gRPC endpoint with an AddressType that is unknown to the current LND wallet, it crashes immediately after the request is made with an exit status of
2/INVALIDARGUMENT
.Your environment
lnd
:v0.15.0
uname -a
on *Nix):Ubuntu 64-bit
btcd
,bitcoind
, or other backend:bitcoind
Testnet
Steps to reproduce
Use the
NewAddress
gRPC endpoint to request an address with anAddressType
that the current LND version is unaware of. https://api.lightning.community/#newaddressExpected behaviour
The gRPC should return an error to the user instead of crashing.
Actual behaviour
LND will immediately crash with an exit status of
2/INVALIDARGUMENT
.