From bbb24db42c4638783285f6402284834fbcedbaef Mon Sep 17 00:00:00 2001 From: Dave Collins Date: Mon, 14 Apr 2014 19:20:00 -0500 Subject: [PATCH] Update for notifynewtxs to notifyreceived rename. The websocket extension command to register for notifications when an address receives funds has been renamed. This commit catches up to the change. ok @jrick --- account.go | 4 ++-- rpcclient.go | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/account.go b/account.go index 73082d2..3cebcad 100644 --- a/account.go +++ b/account.go @@ -425,7 +425,7 @@ func (a *Account) Track() { i++ } - err := NotifyNewTXs(CurrentServerConn(), addrstrs) + err := NotifyReceived(CurrentServerConn(), addrstrs) if err != nil { log.Error("Unable to request transaction updates for address.") } @@ -616,7 +616,7 @@ func (a *Account) ReqNewTxsForAddress(addr btcutil.Address) { log.Debugf("Requesting notifications of TXs sending to address %v", apkh) - err := NotifyNewTXs(CurrentServerConn(), []string{apkh.EncodeAddress()}) + err := NotifyReceived(CurrentServerConn(), []string{apkh.EncodeAddress()}) if err != nil { log.Error("Unable to request transaction updates for address.") } diff --git a/rpcclient.go b/rpcclient.go index cf37530..1259e80 100644 --- a/rpcclient.go +++ b/rpcclient.go @@ -340,10 +340,10 @@ func NotifyBlocks(rpc ServerConn) *btcjson.Error { return jsonErr } -// NotifyNewTXs requests notifications for new transactions that spend +// NotifyReceived requests notifications for new transactions that spend // to any of the addresses in addrs. -func NotifyNewTXs(rpc ServerConn, addrs []string) *btcjson.Error { - cmd := btcws.NewNotifyNewTXsCmd(<-NewJSONID, addrs) +func NotifyReceived(rpc ServerConn, addrs []string) *btcjson.Error { + cmd := btcws.NewNotifyReceivedCmd(<-NewJSONID, addrs) response := <-rpc.SendRequest(NewServerRequest(cmd)) _, jsonErr := response.FinishUnmarshal(nil) return jsonErr