From 53181f3ec3f1c1ddec3f8b51186eb478f01e9b14 Mon Sep 17 00:00:00 2001 From: Braydon Fuller Date: Fri, 29 Sep 2017 18:38:26 -0400 Subject: [PATCH] cmd/lncli+lnwallet: specify need for witness outputs for funding channels In this commit, we extend the help message for `newaddress` to indicate which address types can be used when directly funding channels. Additionally, we add some additional text to the insufficient funding error to detail that we don't have enough witness outputs. --- cmd/lncli/commands.go | 2 +- lnwallet/wallet.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/lncli/commands.go b/cmd/lncli/commands.go index cbd10d1e3..fb618d2ca 100644 --- a/cmd/lncli/commands.go +++ b/cmd/lncli/commands.go @@ -60,7 +60,7 @@ var newAddressCommand = cli.Command{ Description: "Generate a wallet new address. Address-types has to be one of:\n" + " - p2wkh: Push to witness key hash\n" + " - np2wkh: Push to nested witness key hash\n" + - " - p2pkh: Push to public key hash", + " - p2pkh: Push to public key hash (can't be used to fund channels)", Action: newAddress, } diff --git a/lnwallet/wallet.go b/lnwallet/wallet.go index 4470e0ec9..be2734521 100644 --- a/lnwallet/wallet.go +++ b/lnwallet/wallet.go @@ -60,7 +60,7 @@ type ErrInsufficientFunds struct { } func (e *ErrInsufficientFunds) Error() string { - return fmt.Sprintf("not enough outputs to create funding transaction,"+ + return fmt.Sprintf("not enough witness outputs to create funding transaction,"+ " need %v only have %v available", e.amountAvailable, e.amountSelected) }