diff options
author | obscuren <geffobscura@gmail.com> | 2015-01-29 01:22:53 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2015-01-29 01:22:53 +0800 |
commit | 45e15f62f594d6f5191e60a54aead33602838e98 (patch) | |
tree | 5b82273df6a23c219d1e97dbb86b4bdcb620374a /cmd/mist/ui_lib.go | |
parent | fb7c03ff4dc759f7dd2fc5cee65b46111cbb7375 (diff) | |
parent | 7f638f0b2d8d989be25e660178d79df3278e4c84 (diff) | |
download | dexon-45e15f62f594d6f5191e60a54aead33602838e98.tar.gz dexon-45e15f62f594d6f5191e60a54aead33602838e98.tar.zst dexon-45e15f62f594d6f5191e60a54aead33602838e98.zip |
merge jsonrpc
Diffstat (limited to 'cmd/mist/ui_lib.go')
-rw-r--r-- | cmd/mist/ui_lib.go | 54 |
1 files changed, 0 insertions, 54 deletions
diff --git a/cmd/mist/ui_lib.go b/cmd/mist/ui_lib.go index 484fe6289..9fa368a4d 100644 --- a/cmd/mist/ui_lib.go +++ b/cmd/mist/ui_lib.go @@ -21,15 +21,11 @@ package main import ( - "bytes" "fmt" "io/ioutil" "path" - "strconv" - "strings" "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/eth" "github.com/ethereum/go-ethereum/ethutil" "github.com/ethereum/go-ethereum/event/filter" @@ -77,56 +73,6 @@ func (self *UiLib) Notef(args []interface{}) { guilogger.Infoln(args...) } -func (self *UiLib) LookupDomain(domain string) string { - world := self.World() - - if len(domain) > 32 { - domain = string(crypto.Sha3([]byte(domain))) - } - data := world.Config().Get("DnsReg").StorageString(domain).Bytes() - - // Left padded = A record, Right padded = CNAME - if len(data) > 0 && data[0] == 0 { - data = bytes.TrimLeft(data, "\x00") - var ipSlice []string - for _, d := range data { - ipSlice = append(ipSlice, strconv.Itoa(int(d))) - } - - return strings.Join(ipSlice, ".") - } else { - data = bytes.TrimRight(data, "\x00") - - return string(data) - } -} - -func (self *UiLib) LookupName(addr string) string { - var ( - nameReg = self.World().Config().Get("NameReg") - lookup = nameReg.Storage(ethutil.Hex2Bytes(addr)) - ) - - if lookup.Len() != 0 { - return strings.Trim(lookup.Str(), "\x00") - } - - return addr -} - -func (self *UiLib) LookupAddress(name string) string { - var ( - nameReg = self.World().Config().Get("NameReg") - lookup = nameReg.Storage(ethutil.RightPadBytes([]byte(name), 32)) - ) - - if lookup.Len() != 0 { - return ethutil.Bytes2Hex(lookup.Bytes()) - } - - return "" -} - func (self *UiLib) PastPeers() *ethutil.List { return ethutil.NewList([]string{}) //return ethutil.NewList(eth.PastPeers()) |