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
233f5200
Commit
233f5200
authored
Jan 23, 2014
by
obscuren
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Data send over the wire shouldn't be RLPed more then once
parent
878e796c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
8 deletions
+12
-8
ethereum.go
ethereum.go
+3
-2
peer.go
peer.go
+9
-6
No files found.
ethereum.go
View file @
233f5200
...
@@ -122,9 +122,10 @@ func (s *Ethereum) InboundPeers() []*Peer {
...
@@ -122,9 +122,10 @@ func (s *Ethereum) InboundPeers() []*Peer {
return
inboundPeers
[
:
length
]
return
inboundPeers
[
:
length
]
}
}
func
(
s
*
Ethereum
)
Broadcast
(
msgType
ethwire
.
MsgType
,
data
[]
byte
)
{
func
(
s
*
Ethereum
)
Broadcast
(
msgType
ethwire
.
MsgType
,
data
interface
{})
{
msg
:=
ethwire
.
NewMessage
(
msgType
,
data
)
eachPeer
(
s
.
peers
,
func
(
p
*
Peer
,
e
*
list
.
Element
)
{
eachPeer
(
s
.
peers
,
func
(
p
*
Peer
,
e
*
list
.
Element
)
{
p
.
QueueMessage
(
ethwire
.
NewMessage
(
msgType
,
data
)
)
p
.
QueueMessage
(
msg
)
})
})
}
}
...
...
peer.go
View file @
233f5200
...
@@ -170,12 +170,15 @@ out:
...
@@ -170,12 +170,15 @@ out:
// Version message
// Version message
p
.
handleHandshake
(
msg
)
p
.
handleHandshake
(
msg
)
case
ethwire
.
MsgBlockTy
:
case
ethwire
.
MsgBlockTy
:
err
:=
p
.
ethereum
.
BlockManager
.
ProcessBlock
(
ethchain
.
NewBlock
(
msg
.
Data
))
/*
if
err
!=
nil
{
err := p.ethereum.BlockManager.ProcessBlock(ethchain.NewBlock(msg.Data))
log
.
Println
(
err
)
if err != nil {
}
log.Println(err)
}
*/
case
ethwire
.
MsgTxTy
:
case
ethwire
.
MsgTxTy
:
p
.
ethereum
.
TxPool
.
QueueTransaction
(
ethutil
.
NewTransactionFromData
(
msg
.
Data
))
//p.ethereum.TxPool.QueueTransaction(ethchain.NewTransactionFromData(msg.Data))
p
.
ethereum
.
TxPool
.
QueueTransaction
(
ethchain
.
NewTransactionFromRlpValue
(
msg
.
Data
.
Get
(
0
)))
case
ethwire
.
MsgInvTy
:
case
ethwire
.
MsgInvTy
:
case
ethwire
.
MsgGetPeersTy
:
case
ethwire
.
MsgGetPeersTy
:
p
.
requestedPeerList
=
true
p
.
requestedPeerList
=
true
...
@@ -263,7 +266,7 @@ func (p *Peer) pushPeers() {
...
@@ -263,7 +266,7 @@ func (p *Peer) pushPeers() {
}
}
func
(
p
*
Peer
)
handleHandshake
(
msg
*
ethwire
.
Msg
)
{
func
(
p
*
Peer
)
handleHandshake
(
msg
*
ethwire
.
Msg
)
{
c
:=
ethutil
.
Conv
(
msg
.
Data
)
c
:=
msg
.
Data
// [PROTOCOL_VERSION, NETWORK_ID, CLIENT_ID]
// [PROTOCOL_VERSION, NETWORK_ID, CLIENT_ID]
if
c
.
Get
(
2
)
.
AsUint
()
==
p
.
ethereum
.
Nonce
{
if
c
.
Get
(
2
)
.
AsUint
()
==
p
.
ethereum
.
Nonce
{
//if msg.Nonce == p.ethereum.Nonce {
//if msg.Nonce == p.ethereum.Nonce {
...
...
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