Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
Geth-Modification
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张蕾
Geth-Modification
Commits
7272577f
Commit
7272577f
authored
Aug 07, 2014
by
obscuren
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added dns lookup
parent
da50c751
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
1 deletion
+19
-1
config.go
ethpipe/config.go
+5
-0
pub.go
ethpub/pub.go
+13
-0
peer.go
peer.go
+1
-1
No files found.
ethpipe/config.go
View file @
7272577f
...
...
@@ -15,6 +15,11 @@ func (self *Config) Get(name string) *Object {
switch
name
{
case
"NameReg"
:
addr
=
[]
byte
{
0
}
case
"DomainReg"
:
objectAddr
:=
configCtrl
.
GetStorage
(
ethutil
.
BigD
([]
byte
{
0
}))
domainAddr
:=
(
&
Object
{
self
.
pipe
.
World
()
.
safeGet
(
objectAddr
.
Bytes
())})
.
StorageString
(
"DomainReg"
)
.
Bytes
()
return
&
Object
{
self
.
pipe
.
World
()
.
safeGet
(
domainAddr
)}
default
:
addr
=
ethutil
.
RightPadBytes
([]
byte
(
name
),
32
)
}
...
...
ethpub/pub.go
View file @
7272577f
...
...
@@ -10,6 +10,7 @@ import (
"github.com/ethereum/eth-go/ethchain"
"github.com/ethereum/eth-go/ethcrypto"
"github.com/ethereum/eth-go/ethlog"
"github.com/ethereum/eth-go/ethpipe"
"github.com/ethereum/eth-go/ethstate"
"github.com/ethereum/eth-go/ethutil"
)
...
...
@@ -41,6 +42,7 @@ func (self helper) NameReg() *ethstate.StateObject {
return
nil
}
// TODO Re-write / refactor
type
PEthereum
struct
{
manager
ethchain
.
EthManager
stateManager
*
ethchain
.
StateManager
...
...
@@ -65,6 +67,17 @@ func New(manager ethchain.EthManager) *PEthereum {
}
}
func
(
self
*
PEthereum
)
LookupDomain
(
domain
string
)
string
{
pipe
:=
ethpipe
.
New
(
self
.
manager
)
world
:=
pipe
.
World
()
if
len
(
domain
)
>
32
{
domain
=
string
(
ethcrypto
.
Sha3Bin
([]
byte
(
domain
)))
}
return
strings
.
Trim
(
world
.
Config
()
.
Get
(
"DomainReg"
)
.
StorageString
(
domain
)
.
Str
(),
"
\x00
"
)
}
func
(
lib
*
PEthereum
)
GetBlock
(
hexHash
string
)
*
PBlock
{
hash
:=
ethutil
.
Hex2Bytes
(
hexHash
)
block
:=
lib
.
blockChain
.
GetBlock
(
hash
)
...
...
peer.go
View file @
7272577f
...
...
@@ -449,7 +449,7 @@ func (p *Peer) HandleInbound() {
peerlogger
.
Infof
(
"Attempting to catch (%x). Parent unknown
\n
"
,
b
.
Hash
())
p
.
catchingUp
=
false
p
.
CatchupWithPeer
(
b
.
Hash
()
)
p
.
CatchupWithPeer
(
b
.
PrevHash
)
peerlogger
.
Infoln
(
b
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment