From 6ad803b99c20809cf39b29554b828cbac4593490 Mon Sep 17 00:00:00 2001 From: Olaoluwa Osuntokun Date: Tue, 22 Aug 2017 00:23:24 -0700 Subject: [PATCH] rpc: make NewWitnessAddress return np2wkh addresses MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This commit modifies NewWitnessAddress to return nested p2wkh address. We do this as this RPC call was put in place to be used within GUI’s to allow users to deposit funds into their LN wallet. By using nested p2wkh, we ensure that the generate address that can be used to directly create channels. --- rpcserver.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/rpcserver.go b/rpcserver.go index c9bb9c21..c3888c50 100644 --- a/rpcserver.go +++ b/rpcserver.go @@ -245,7 +245,9 @@ func (r *rpcServer) NewWitnessAddress(ctx context.Context, } } - addr, err := r.server.cc.wallet.NewAddress(lnwallet.WitnessPubKey, false) + addr, err := r.server.cc.wallet.NewAddress( + lnwallet.NestedWitnessPubKey, false, + ) if err != nil { return nil, err }