diff options
author | obscuren <geffobscura@gmail.com> | 2015-01-29 01:14:28 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2015-01-29 01:14:28 +0800 |
commit | 7f638f0b2d8d989be25e660178d79df3278e4c84 (patch) | |
tree | 85c74ca9ca6c604df04e13c9d90d8af15b99e8d6 /cmd/mist/ui_lib.go | |
parent | b46e1ca97e61ebfe4c37961e723142245efe5016 (diff) | |
download | go-tangerine-7f638f0b2d8d989be25e660178d79df3278e4c84.tar.gz go-tangerine-7f638f0b2d8d989be25e660178d79df3278e4c84.tar.zst go-tangerine-7f638f0b2d8d989be25e660178d79df3278e4c84.zip |
moving to a better xeth
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 e0321f6dd..ca3884a82 100644 --- a/cmd/mist/ui_lib.go +++ b/cmd/mist/ui_lib.go @@ -21,15 +21,11 @@ package main import ( - "bytes" "fmt" "path" - "strconv" - "strings" "github.com/ethereum/go-ethereum/core" "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" @@ -79,56 +75,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()) |