rpc: update RPC server to disallow p2pkh adds, assume segwit for ConfirmedBalance
This commit is contained in:
parent
525cca02e2
commit
b41222b316
@ -463,8 +463,6 @@ func (r *rpcServer) NewAddress(ctx context.Context,
|
|||||||
addrType = lnwallet.WitnessPubKey
|
addrType = lnwallet.WitnessPubKey
|
||||||
case lnrpc.NewAddressRequest_NESTED_PUBKEY_HASH:
|
case lnrpc.NewAddressRequest_NESTED_PUBKEY_HASH:
|
||||||
addrType = lnwallet.NestedWitnessPubKey
|
addrType = lnwallet.NestedWitnessPubKey
|
||||||
case lnrpc.NewAddressRequest_PUBKEY_HASH:
|
|
||||||
addrType = lnwallet.PubKeyHash
|
|
||||||
}
|
}
|
||||||
|
|
||||||
addr, err := r.server.cc.wallet.NewAddress(addrType, false)
|
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) {
|
in *lnrpc.WalletBalanceRequest) (*lnrpc.WalletBalanceResponse, error) {
|
||||||
|
|
||||||
// Get total balance, from txs that have >= 0 confirmations.
|
// 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 {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get confirmed balance, from txs that have >= 1 confirmations.
|
// 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 {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user