From f8d828ff4255d37f813211bce1e76651b42b3a56 Mon Sep 17 00:00:00 2001 From: Andrey Grehov Date: Sun, 28 Apr 2019 00:11:40 -0400 Subject: [PATCH] rpc: implemented AddWatchedScript --- api/rpc.go | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/api/rpc.go b/api/rpc.go index 02586cb..7b3155f 100644 --- a/api/rpc.go +++ b/api/rpc.go @@ -188,7 +188,16 @@ func (s *server) BumpFee(ctx context.Context, in *pb.Txid) (*pb.Txid, error) { } func (s *server) AddWatchedScript(ctx context.Context, in *pb.Address) (*pb.Empty, error) { - return nil, nil + ct := coinType(in.Coin) + wal, err := s.w.WalletForCurrencyCode(ct.CurrencyCode()) + if err != nil { + return nil, err + } + addr, err := wal.DecodeAddress(in.Addr) + if err != nil { + return nil, err + } + return &pb.Empty{}, wal.AddWatchedAddress(addr) } func (s *server) GetConfirmations(ctx context.Context, in *pb.Txid) (*pb.Confirmations, error) {