rpc: update address generation to new API

This commit is contained in:
Olaoluwa Osuntokun 2016-05-23 14:18:04 -07:00
parent 77b756c651
commit 422c0d6c93
2 changed files with 5 additions and 5 deletions

View file

@ -726,7 +726,7 @@ func getNewAddress(icmd interface{}, w *wallet.Wallet) (interface{}, error) {
if err != nil {
return nil, err
}
addr, err := w.NewAddress(account)
addr, err := w.NewAddress(account, waddrmgr.PubKeyHash)
if err != nil {
return nil, err
}
@ -751,7 +751,7 @@ func getRawChangeAddress(icmd interface{}, w *wallet.Wallet) (interface{}, error
if err != nil {
return nil, err
}
addr, err := w.NewChangeAddress(account)
addr, err := w.NewChangeAddress(account, waddrmgr.PubKeyHash)
if err != nil {
return nil, err
}

View file

@ -230,9 +230,9 @@ func (s *walletServer) NextAddress(ctx context.Context, req *pb.NextAddressReque
)
switch req.Kind {
case pb.NextAddressRequest_BIP0044_EXTERNAL:
addr, err = s.wallet.NewAddress(req.Account)
addr, err = s.wallet.NewAddress(req.Account, waddrmgr.PubKeyHash)
case pb.NextAddressRequest_BIP0044_INTERNAL:
addr, err = s.wallet.NewChangeAddress(req.Account)
addr, err = s.wallet.NewChangeAddress(req.Account, waddrmgr.PubKeyHash)
default:
return nil, grpc.Errorf(codes.InvalidArgument, "kind=%v", req.Kind)
}
@ -379,7 +379,7 @@ func (s *walletServer) FundTransaction(ctx context.Context, req *pb.FundTransact
var changeScript []byte
if req.IncludeChangeScript && totalAmount > btcutil.Amount(req.TargetAmount) {
changeAddr, err := s.wallet.NewChangeAddress(req.Account)
changeAddr, err := s.wallet.NewChangeAddress(req.Account, waddrmgr.PubKeyHash)
if err != nil {
return nil, translateError(err)
}