Skip to content

Commit

Permalink
Merge pull request #8378 from guggero/fundpsbt-coin-select
Browse files Browse the repository at this point in the history
walletrpc: unify coin selection, allow coin selection for PSBT with pre-defined inputs
  • Loading branch information
Roasbeef authored Feb 27, 2024
2 parents 935e550 + c307d1e commit 5a96026
Show file tree
Hide file tree
Showing 35 changed files with 3,930 additions and 1,124 deletions.
25 changes: 25 additions & 0 deletions cmd/lncli/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import (
"syscall"

"github.com/btcsuite/btcd/btcutil"
"github.com/btcsuite/btcd/chaincfg"
"github.com/lightningnetwork/lnd"
"github.com/lightningnetwork/lnd/build"
"github.com/lightningnetwork/lnd/lncfg"
Expand Down Expand Up @@ -537,3 +538,27 @@ func readPassword(text string) ([]byte, error) {
fmt.Println()
return pw, err
}

// networkParams parses the global network flag into a chaincfg.Params.
func networkParams(ctx *cli.Context) (*chaincfg.Params, error) {
network := strings.ToLower(ctx.GlobalString("network"))
switch network {
case "mainnet":
return &chaincfg.MainNetParams, nil

case "testnet":
return &chaincfg.TestNet3Params, nil

case "regtest":
return &chaincfg.RegressionNetParams, nil

case "simnet":
return &chaincfg.SimNetParams, nil

case "signet":
return &chaincfg.SigNetParams, nil

default:
return nil, fmt.Errorf("unknown network: %v", network)
}
}
Loading

0 comments on commit 5a96026

Please sign in to comment.