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
75f0412f
Commit
75f0412f
authored
10 years ago
by
obscuren
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'ebuchman-badsig' into poc8
parents
6e24b158
207b6c50
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
14 additions
and
10 deletions
+14
-10
gui.go
cmd/mist/gui.go
+3
-3
transaction_pool.go
core/transaction_pool.go
+6
-2
transaction.go
core/types/transaction.go
+4
-4
js_types.go
xeth/js_types.go
+1
-1
No files found.
cmd/mist/gui.go
View file @
75f0412f
...
...
@@ -301,7 +301,7 @@ func (gui *Gui) insertTransaction(window string, tx *types.Transaction) {
addr
:=
gui
.
address
()
var
inout
string
if
bytes
.
Compare
(
tx
.
Sender
(),
addr
)
==
0
{
if
bytes
.
Compare
(
tx
.
From
(),
addr
)
==
0
{
inout
=
"send"
}
else
{
inout
=
"recv"
...
...
@@ -321,7 +321,7 @@ func (gui *Gui) insertTransaction(window string, tx *types.Transaction) {
if
send
.
Len
()
!=
0
{
s
=
strings
.
Trim
(
send
.
Str
(),
"
\x00
"
)
}
else
{
s
=
ethutil
.
Bytes2Hex
(
tx
.
Sender
())
s
=
ethutil
.
Bytes2Hex
(
tx
.
From
())
}
if
rec
.
Len
()
!=
0
{
r
=
strings
.
Trim
(
rec
.
Str
(),
"
\x00
"
)
...
...
@@ -453,7 +453,7 @@ func (gui *Gui) update() {
tx
:=
ev
.
Tx
object
:=
state
.
GetAccount
(
gui
.
address
())
if
bytes
.
Compare
(
tx
.
Sender
(),
gui
.
address
())
==
0
{
if
bytes
.
Compare
(
tx
.
From
(),
gui
.
address
())
==
0
{
object
.
SubAmount
(
tx
.
Value
())
gui
.
txDb
.
Put
(
tx
.
Hash
(),
tx
.
RlpEncode
())
...
...
This diff is collapsed.
Click to expand it.
core/transaction_pool.go
View file @
75f0412f
...
...
@@ -116,7 +116,11 @@ func (pool *TxPool) ValidateTransaction(tx *types.Transaction) error {
}
// Get the sender
sender
:=
pool
.
chainManager
.
State
()
.
GetAccount
(
tx
.
Sender
())
senderAddr
:=
tx
.
From
()
if
senderAddr
==
nil
{
return
fmt
.
Errorf
(
"invalid sender"
)
}
sender
:=
pool
.
chainManager
.
State
()
.
GetAccount
(
senderAddr
)
totAmount
:=
new
(
big
.
Int
)
.
Set
(
tx
.
Value
())
// Make sure there's enough in the sender's account. Having insufficient
...
...
@@ -193,7 +197,7 @@ func (pool *TxPool) RemoveInvalid(state *state.StateDB) {
for
e
:=
pool
.
pool
.
Front
();
e
!=
nil
;
e
=
e
.
Next
()
{
tx
:=
e
.
Value
.
(
*
types
.
Transaction
)
sender
:=
state
.
GetAccount
(
tx
.
Sender
())
sender
:=
state
.
GetAccount
(
tx
.
From
())
err
:=
pool
.
ValidateTransaction
(
tx
)
if
err
!=
nil
||
sender
.
Nonce
>=
tx
.
Nonce
()
{
pool
.
pool
.
Remove
(
e
)
...
...
This diff is collapsed.
Click to expand it.
core/types/transaction.go
View file @
75f0412f
...
...
@@ -77,7 +77,7 @@ func (self *Transaction) SetNonce(nonce uint64) {
}
func
(
self
*
Transaction
)
From
()
[]
byte
{
return
self
.
S
ender
()
return
self
.
s
ender
()
}
func
(
self
*
Transaction
)
To
()
[]
byte
{
...
...
@@ -114,12 +114,12 @@ func (tx *Transaction) PublicKey() []byte {
return
pubkey
}
func
(
tx
*
Transaction
)
S
ender
()
[]
byte
{
func
(
tx
*
Transaction
)
s
ender
()
[]
byte
{
pubkey
:=
tx
.
PublicKey
()
// Validate the returned key.
// 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
}
...
...
@@ -187,7 +187,7 @@ func (tx *Transaction) String() string {
`
,
tx
.
Hash
(),
len
(
tx
.
recipient
)
==
0
,
tx
.
Sender
(),
tx
.
From
(),
tx
.
recipient
,
tx
.
nonce
,
tx
.
gasPrice
,
...
...
This diff is collapsed.
Click to expand it.
xeth/js_types.go
View file @
75f0412f
...
...
@@ -100,7 +100,7 @@ func NewJSTx(tx *types.Transaction, state *state.StateDB) *JSTransaction {
if
receiver
==
"0000000000000000000000000000000000000000"
{
receiver
=
ethutil
.
Bytes2Hex
(
core
.
AddressFromMessage
(
tx
))
}
sender
:=
ethutil
.
Bytes2Hex
(
tx
.
Sender
())
sender
:=
ethutil
.
Bytes2Hex
(
tx
.
From
())
createsContract
:=
core
.
MessageCreatesContract
(
tx
)
var
data
string
...
...
This diff is collapsed.
Click to expand it.
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