From b41222b3166469eb02d360d2c69d33e74fe56c9b Mon Sep 17 00:00:00 2001 From: Olaoluwa Osuntokun Date: Sat, 17 Feb 2018 15:38:06 -0800 Subject: [PATCH] rpc: update RPC server to disallow p2pkh adds, assume segwit for ConfirmedBalance --- rpcserver.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/rpcserver.go b/rpcserver.go index 2416a31c..663cad8b 100644 --- a/rpcserver.go +++ b/rpcserver.go @@ -463,8 +463,6 @@ func (r *rpcServer) NewAddress(ctx context.Context, addrType = lnwallet.WitnessPubKey case lnrpc.NewAddressRequest_NESTED_PUBKEY_HASH: addrType = lnwallet.NestedWitnessPubKey - case lnrpc.NewAddressRequest_PUBKEY_HASH: - addrType = lnwallet.PubKeyHash } addr, err := r.server.cc.wallet.NewAddress(addrType, false) @@ -1264,13 +1262,13 @@ func (r *rpcServer) WalletBalance(ctx context.Context, in *lnrpc.WalletBalanceRequest) (*lnrpc.WalletBalanceResponse, error) { // Get total balance, from txs that have >= 0 confirmations. - totalBal, err := r.server.cc.wallet.ConfirmedBalance(0, in.WitnessOnly) + totalBal, err := r.server.cc.wallet.ConfirmedBalance(0) if err != nil { return nil, err } // Get confirmed balance, from txs that have >= 1 confirmations. - confirmedBal, err := r.server.cc.wallet.ConfirmedBalance(1, in.WitnessOnly) + confirmedBal, err := r.server.cc.wallet.ConfirmedBalance(1) if err != nil { return nil, err }