Allow notifications to work for all address types.

Previously the websocket notifications for addresses were limited to
pay-to-pubkey-hash only.  This commit removes that restriction so
all btcutil.Address types are supported.  This includes pay-to-pubkey,
pay-to-pubkey-hash, and pay-to-script-hash.
This commit is contained in:
Dave Collins 2014-02-19 09:47:17 -06:00
parent 7162a11995
commit 8ac86f1053

View file

@ -1231,16 +1231,6 @@ func handleNotifyNewTXs(wsc *wsClient, icmd btcjson.Cmd) (interface{}, *btcjson.
return nil, &e return nil, &e
} }
// TODO(jrick) Notifying for non-P2PKH addresses is currently
// unsuported.
if _, ok := addr.(*btcutil.AddressPubKeyHash); !ok {
e := btcjson.Error{
Code: btcjson.ErrInvalidAddressOrKey.Code,
Message: fmt.Sprintf("Invalid address or key: %v", addr.EncodeAddress()),
}
return nil, &e
}
wsc.server.ntfnMgr.AddAddrRequest(wsc, addr.EncodeAddress()) wsc.server.ntfnMgr.AddAddrRequest(wsc, addr.EncodeAddress())
} }