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
7c24cd79
Commit
7c24cd79
authored
Nov 29, 2014
by
Ethan Buchman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix panic on bad sender
parent
8cf9ed0e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
2 deletions
+6
-2
transaction_pool.go
chain/transaction_pool.go
+5
-1
transaction.go
chain/types/transaction.go
+1
-1
No files found.
chain/transaction_pool.go
View file @
7c24cd79
...
@@ -116,7 +116,11 @@ func (pool *TxPool) ValidateTransaction(tx *types.Transaction) error {
...
@@ -116,7 +116,11 @@ func (pool *TxPool) ValidateTransaction(tx *types.Transaction) error {
// Get the sender
// Get the sender
//sender := pool.Ethereum.BlockManager().procState.GetAccount(tx.Sender())
//sender := pool.Ethereum.BlockManager().procState.GetAccount(tx.Sender())
sender
:=
pool
.
Ethereum
.
BlockManager
()
.
CurrentState
()
.
GetAccount
(
tx
.
Sender
())
senderAddr
:=
tx
.
Sender
()
if
senderAddr
==
nil
{
return
fmt
.
Errorf
(
"Invalid sender"
)
}
sender
:=
pool
.
Ethereum
.
BlockManager
()
.
CurrentState
()
.
GetAccount
(
senderAddr
)
totAmount
:=
new
(
big
.
Int
)
.
Set
(
tx
.
Value
)
totAmount
:=
new
(
big
.
Int
)
.
Set
(
tx
.
Value
)
// Make sure there's enough in the sender's account. Having insufficient
// Make sure there's enough in the sender's account. Having insufficient
...
...
chain/types/transaction.go
View file @
7c24cd79
...
@@ -116,7 +116,7 @@ func (tx *Transaction) Sender() []byte {
...
@@ -116,7 +116,7 @@ func (tx *Transaction) Sender() []byte {
// Validate the returned key.
// Validate the returned key.
// Return nil if public key isn't in full format
// Return nil if public key isn't in full format
if
len
(
pubkey
)
!=
0
&&
pubkey
[
0
]
!=
4
{
if
len
(
pubkey
)
==
0
||
pubkey
[
0
]
!=
4
{
return
nil
return
nil
}
}
...
...
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