2
0
mirror of https://github.com/namecoin/ncdns synced 2024-11-16 00:13:01 +00:00

Pass stream isolation through to namecoind

This commit is contained in:
JeremyRand 2019-10-27 18:21:14 +00:00
parent 4a1381cd41
commit 86b9348f50
No known key found for this signature in database
GPG Key ID: B3F2D165786D6570

View File

@ -1,12 +1,11 @@
package namecoin
import (
"fmt"
"github.com/namecoin/btcd/btcjson"
"github.com/namecoin/btcd/rpcclient"
"gopkg.in/hlandau/madns.v2/merr"
"github.com/namecoin/ncbtcjson"
"github.com/namecoin/ncrpcclient"
)
@ -28,12 +27,7 @@ func New(config *rpcclient.ConnConfig, ntfnHandlers *rpcclient.NotificationHandl
// NameQuery returns the value of a name. If the name doesn't exist, the error
// returned will be merr.ErrNoSuchDomain.
func (c *Client) NameQuery(name string, streamIsolationID string) (string, error) {
// TODO: Pass stream isolation ID to namecoind, and remove this error
if streamIsolationID != "" {
return "", fmt.Errorf("Stream isolation ID '%s' is not yet passed to namecoind", streamIsolationID)
}
nameData, err := c.NameShow(name)
nameData, err := c.NameShow(name, &ncbtcjson.NameShowOptions{StreamID: streamIsolationID})
if err != nil {
if jerr, ok := err.(*btcjson.RPCError); ok {
if jerr.Code == btcjson.ErrRPCWallet {