Skip to content

Commit

Permalink
Merge branch 'develop' of github.com:ethereum/eth-go into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
zelig committed Aug 14, 2014
2 parents e85f397 + fa88122 commit 0283498
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
2 changes: 1 addition & 1 deletion ethchain/bloom.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ type BloomFilter struct {

func NewBloomFilter(bin []byte) *BloomFilter {
if bin == nil {
bin = make([]byte, 255)
bin = make([]byte, 256)
}

return &BloomFilter{
Expand Down
17 changes: 16 additions & 1 deletion ethpub/pub.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"bytes"
"encoding/json"
"math/big"
"strconv"
"strings"
"sync/atomic"

Expand Down Expand Up @@ -74,8 +75,22 @@ func (self *PEthereum) LookupDomain(domain string) string {
if len(domain) > 32 {
domain = string(ethcrypto.Sha3Bin([]byte(domain)))
}
data := world.Config().Get("DnsReg").StorageString(domain).Bytes()

// Left padded = A record, Right padded = CNAME
if 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 strings.Trim(world.Config().Get("DnsReg").StorageString(domain).Str(), "\x00")
return string(data)
}
}

func (lib *PEthereum) GetBlock(hexHash string) *PBlock {
Expand Down

0 comments on commit 0283498

Please sign in to comment.