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
03403399
Commit
03403399
authored
Mar 13, 2015
by
obscuren
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Return proper error
parent
a0266489
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
7 additions
and
1 deletion
+7
-1
chain_manager.go
core/chain_manager.go
+2
-0
error.go
core/error.go
+1
-1
state_transition.go
core/state_transition.go
+3
-0
worker.go
miner/worker.go
+1
-0
No files found.
core/chain_manager.go
View file @
03403399
...
...
@@ -449,6 +449,8 @@ func (self *ChainManager) InsertChain(chain types.Blocks) error {
*/
self
.
setTransState
(
state
.
New
(
block
.
Root
(),
self
.
stateDb
))
self
.
setTxState
(
state
.
New
(
block
.
Root
(),
self
.
stateDb
))
queue
[
i
]
=
ChainEvent
{
block
}
queueEvent
.
canonicalCount
++
}
else
{
...
...
core/error.go
View file @
03403399
...
...
@@ -78,7 +78,7 @@ func (err *NonceErr) Error() string {
}
func
NonceError
(
is
,
exp
uint64
)
*
NonceErr
{
return
&
NonceErr
{
Message
:
fmt
.
Sprintf
(
"
Nonce err. Is %d, expected %d
"
,
is
,
exp
),
Is
:
is
,
Exp
:
exp
}
return
&
NonceErr
{
Message
:
fmt
.
Sprintf
(
"
Transaction w/ invalid nonce (%d / %d)
"
,
is
,
exp
),
Is
:
is
,
Exp
:
exp
}
}
func
IsNonceErr
(
err
error
)
bool
{
...
...
core/state_transition.go
View file @
03403399
...
...
@@ -148,6 +148,9 @@ func (self *StateTransition) preCheck() (err error) {
// Pre-pay gas / Buy gas of the coinbase account
if
err
=
self
.
BuyGas
();
err
!=
nil
{
if
state
.
IsGasLimitErr
(
err
)
{
return
err
}
return
InvalidTxError
(
err
)
}
...
...
miner/worker.go
View file @
03403399
...
...
@@ -212,6 +212,7 @@ gasLimit:
fallthrough
case
core
.
IsInvalidTxErr
(
err
)
:
// Remove invalid transactions
self
.
chain
.
TxState
()
.
RemoveNonce
(
tx
.
From
(),
tx
.
Nonce
())
remove
=
append
(
remove
,
tx
)
case
state
.
IsGasLimitErr
(
err
)
:
// Break on gas limit
...
...
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