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
3a9d7d31
Commit
3a9d7d31
authored
Jun 12, 2014
by
obscuren
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
log changes
parent
1938bfcd
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
13 additions
and
10 deletions
+13
-10
transaction_pool.go
ethchain/transaction_pool.go
+6
-0
pub.go
ethpub/pub.go
+0
-2
config.go
ethutil/config.go
+5
-7
peer.go
peer.go
+2
-1
No files found.
ethchain/transaction_pool.go
View file @
3a9d7d31
...
...
@@ -162,6 +162,10 @@ func (pool *TxPool) ValidateTransaction(tx *Transaction) error {
return
errors
.
New
(
"[TXPL] No last block on the block chain"
)
}
if
len
(
tx
.
Recipient
)
!=
20
{
return
fmt
.
Errorf
(
"[TXPL] Invalid recipient. len = %d"
,
len
(
tx
.
Recipient
))
}
// Get the sender
//sender := pool.Ethereum.StateManager().procState.GetAccount(tx.Sender())
sender
:=
pool
.
Ethereum
.
StateManager
()
.
CurrentState
()
.
GetAccount
(
tx
.
Sender
())
...
...
@@ -207,6 +211,8 @@ out:
// Call blocking version.
pool
.
addTransaction
(
tx
)
ethutil
.
Config
.
Log
.
Debugf
(
"%x => %x (%v) %x
\n
"
,
tx
.
Sender
()[
:
4
],
tx
.
Recipient
[
:
4
],
tx
.
Value
,
tx
.
Hash
())
// Notify the subscribers
pool
.
Ethereum
.
Reactor
()
.
Post
(
"newTx:pre"
,
tx
)
}
...
...
ethpub/pub.go
View file @
3a9d7d31
...
...
@@ -193,8 +193,6 @@ func (lib *PEthereum) createTx(key, recipient, valueStr, gasStr, gasPriceStr, sc
if
contractCreation
{
ethutil
.
Config
.
Log
.
Infof
(
"Contract addr %x"
,
tx
.
CreationAddress
())
}
else
{
ethutil
.
Config
.
Log
.
Infof
(
"Tx hash %x"
,
tx
.
Hash
())
}
return
NewPReciept
(
contractCreation
,
tx
.
CreationAddress
(),
tx
.
Hash
(),
keyPair
.
Address
()),
nil
...
...
ethutil/config.go
View file @
3a9d7d31
...
...
@@ -75,11 +75,11 @@ func ReadConfig(base string, logTypes LoggerType, g *globalconf.GlobalConf, id s
if
Config
==
nil
{
path
:=
ApplicationFolder
(
base
)
Config
=
&
config
{
ExecPath
:
path
,
Debug
:
true
,
Ver
:
"0.5.
0 RC
12"
}
Config
=
&
config
{
ExecPath
:
path
,
Debug
:
true
,
Ver
:
"0.5.12"
}
Config
.
conf
=
g
Config
.
Identifier
=
id
Config
.
Log
=
NewLogger
(
logTypes
,
LogLevelDebug
)
Config
.
SetClientString
(
"
/
Ethereum(G)"
)
Config
.
SetClientString
(
"Ethereum(G)"
)
}
return
Config
...
...
@@ -88,11 +88,9 @@ func ReadConfig(base string, logTypes LoggerType, g *globalconf.GlobalConf, id s
// Set client string
//
func
(
c
*
config
)
SetClientString
(
str
string
)
{
id
:=
runtime
.
GOOS
if
len
(
c
.
Identifier
)
>
0
{
id
=
c
.
Identifier
}
Config
.
ClientString
=
fmt
.
Sprintf
(
"%s nv%s/%s"
,
str
,
c
.
Ver
,
id
)
os
:=
runtime
.
GOOS
cust
:=
c
.
Identifier
Config
.
ClientString
=
fmt
.
Sprintf
(
"%s/v%s/%s/%s/Go"
,
str
,
c
.
Ver
,
cust
,
os
)
}
func
(
c
*
config
)
SetIdentifier
(
id
string
)
{
...
...
peer.go
View file @
3a9d7d31
...
...
@@ -153,6 +153,7 @@ func NewPeer(conn net.Conn, ethereum *Ethereum, inbound bool) *Peer {
pubkey
:
pubkey
,
blocksRequested
:
10
,
caps
:
ethereum
.
ServerCaps
(),
version
:
ethutil
.
Config
.
ClientString
,
}
}
...
...
@@ -579,7 +580,7 @@ func (p *Peer) pushHandshake() error {
pubkey
:=
keyRing
.
PublicKey
msg
:=
ethwire
.
NewMessage
(
ethwire
.
MsgHandshakeTy
,
[]
interface
{}{
uint32
(
ProtocolVersion
),
uint32
(
0
),
p
.
version
,
byte
(
p
.
caps
),
p
.
port
,
pubkey
[
1
:
],
uint32
(
ProtocolVersion
),
uint32
(
0
),
[]
byte
(
p
.
version
)
,
byte
(
p
.
caps
),
p
.
port
,
pubkey
[
1
:
],
})
p
.
QueueMessage
(
msg
)
...
...
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