good morning!!!!
Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
B
bor
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Harbor Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
open
bor
Commits
bc1a173d
Commit
bc1a173d
authored
10 years ago
by
Jeffrey Wilcke
Browse files
Options
Downloads
Plain Diff
Merge branch 'hotfix/0.6.5-3' into develop
parents
b73c07dd
6800c366
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
ethchain/transaction_pool.go
+6
-0
6 additions, 0 deletions
ethchain/transaction_pool.go
ethutil/script.go
+1
-1
1 addition, 1 deletion
ethutil/script.go
peer.go
+30
-11
30 additions, 11 deletions
peer.go
with
37 additions
and
12 deletions
ethchain/transaction_pool.go
+
6
−
0
View file @
bc1a173d
...
...
@@ -27,6 +27,8 @@ const (
minGasPrice
=
1000000
)
var
MinGasPrice
=
big
.
NewInt
(
10000000000000
)
type
TxMsg
struct
{
Tx
*
Transaction
Type
TxMsgTy
...
...
@@ -103,6 +105,10 @@ func (pool *TxPool) ValidateTransaction(tx *Transaction) error {
return
fmt
.
Errorf
(
"[TXPL] Invalid recipient. len = %d"
,
len
(
tx
.
Recipient
))
}
if
tx
.
GasPrice
.
Cmp
(
MinGasPrice
)
>=
0
{
return
fmt
.
Errorf
(
"Gas price to low. Require %v > Got %v"
,
MinGasPrice
,
tx
.
GasPrice
)
}
// Get the sender
//sender := pool.Ethereum.StateManager().procState.GetAccount(tx.Sender())
sender
:=
pool
.
Ethereum
.
StateManager
()
.
CurrentState
()
.
GetAccount
(
tx
.
Sender
())
...
...
This diff is collapsed.
Click to expand it.
ethutil/script.go
+
1
−
1
View file @
bc1a173d
// +build !windows
// +build !windows
!cgo
package
ethutil
import
(
...
...
This diff is collapsed.
Click to expand it.
peer.go
+
30
−
11
View file @
bc1a173d
...
...
@@ -155,6 +155,8 @@ type Peer struct {
pingStartTime
time
.
Time
lastRequestedBlock
*
ethchain
.
Block
protocolCaps
*
ethutil
.
Value
}
func
NewPeer
(
conn
net
.
Conn
,
ethereum
*
Ethereum
,
inbound
bool
)
*
Peer
{
...
...
@@ -173,20 +175,22 @@ func NewPeer(conn net.Conn, ethereum *Ethereum, inbound bool) *Peer {
blocksRequested
:
10
,
caps
:
ethereum
.
ServerCaps
(),
version
:
ethereum
.
ClientIdentity
()
.
String
(),
protocolCaps
:
ethutil
.
NewValue
(
nil
),
}
}
func
NewOutboundPeer
(
addr
string
,
ethereum
*
Ethereum
,
caps
Caps
)
*
Peer
{
p
:=
&
Peer
{
outputQueue
:
make
(
chan
*
ethwire
.
Msg
,
outputBufferSize
),
quit
:
make
(
chan
bool
),
ethereum
:
ethereum
,
inbound
:
false
,
connected
:
0
,
disconnect
:
0
,
port
:
30303
,
caps
:
caps
,
version
:
ethereum
.
ClientIdentity
()
.
String
(),
outputQueue
:
make
(
chan
*
ethwire
.
Msg
,
outputBufferSize
),
quit
:
make
(
chan
bool
),
ethereum
:
ethereum
,
inbound
:
false
,
connected
:
0
,
disconnect
:
0
,
port
:
30303
,
caps
:
caps
,
version
:
ethereum
.
ClientIdentity
()
.
String
(),
protocolCaps
:
ethutil
.
NewValue
(
nil
),
}
// Set up the connection in another goroutine so we don't block the main thread
...
...
@@ -568,7 +572,7 @@ func (self *Peer) FetchBlocks() {
func
(
self
*
Peer
)
FetchHashes
()
{
blockPool
:=
self
.
ethereum
.
blockPool
if
self
.
td
.
Cmp
(
blockPool
.
td
)
>=
0
{
if
self
.
statusKnown
&&
self
.
td
.
Cmp
(
blockPool
.
td
)
>=
0
{
blockPool
.
td
=
self
.
td
if
!
blockPool
.
HasLatestHash
()
{
...
...
@@ -585,7 +589,10 @@ out:
for
{
select
{
case
<-
serviceTimer
.
C
:
if
time
.
Since
(
self
.
lastBlockReceived
)
>
10
*
time
.
Second
{
since
:=
time
.
Since
(
self
.
lastBlockReceived
)
if
since
>
10
*
time
.
Second
&&
self
.
ethereum
.
blockPool
.
Len
()
!=
0
&&
self
.
IsCap
(
"eth"
)
{
self
.
FetchHashes
()
}
else
if
since
>
5
*
time
.
Second
{
self
.
catchingUp
=
false
}
case
<-
self
.
quit
:
...
...
@@ -789,6 +796,7 @@ func (p *Peer) handleHandshake(msg *ethwire.Msg) {
p
.
ethereum
.
PushPeer
(
p
)
p
.
ethereum
.
reactor
.
Post
(
"peerList"
,
p
.
ethereum
.
Peers
())
p
.
protocolCaps
=
caps
capsIt
:=
caps
.
NewIterator
()
var
capsStrs
[]
string
for
capsIt
.
Next
()
{
...
...
@@ -806,6 +814,17 @@ func (p *Peer) handleHandshake(msg *ethwire.Msg) {
peerlogger
.
Debugln
(
p
)
}
func
(
self
*
Peer
)
IsCap
(
cap
string
)
bool
{
capsIt
:=
self
.
protocolCaps
.
NewIterator
()
for
capsIt
.
Next
()
{
if
capsIt
.
Value
()
.
Str
()
==
cap
{
return
true
}
}
return
false
}
func
(
p
*
Peer
)
String
()
string
{
var
strBoundType
string
if
p
.
inbound
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment