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
7277c420
Commit
7277c420
authored
Mar 30, 2014
by
obscuren
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed some state issues
parent
7cc28c8b
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
7 additions
and
6 deletions
+7
-6
state_manager.go
ethchain/state_manager.go
+3
-3
transaction.go
ethchain/transaction.go
+2
-1
vm.go
ethchain/vm.go
+2
-0
vm_test.go
ethchain/vm_test.go
+0
-2
No files found.
ethchain/state_manager.go
View file @
7277c420
...
@@ -82,7 +82,7 @@ func (sm *StateManager) WatchAddr(addr []byte) *AccountState {
...
@@ -82,7 +82,7 @@ func (sm *StateManager) WatchAddr(addr []byte) *AccountState {
func
(
sm
*
StateManager
)
GetAddrState
(
addr
[]
byte
)
*
AccountState
{
func
(
sm
*
StateManager
)
GetAddrState
(
addr
[]
byte
)
*
AccountState
{
account
:=
sm
.
addrStateStore
.
Get
(
addr
)
account
:=
sm
.
addrStateStore
.
Get
(
addr
)
if
account
==
nil
{
if
account
==
nil
{
a
:=
sm
.
bc
.
CurrentBlock
.
s
tate
.
GetAccount
(
addr
)
a
:=
sm
.
procS
tate
.
GetAccount
(
addr
)
account
=
&
AccountState
{
Nonce
:
a
.
Nonce
,
Account
:
a
}
account
=
&
AccountState
{
Nonce
:
a
.
Nonce
,
Account
:
a
}
}
}
...
@@ -128,9 +128,9 @@ func (sm *StateManager) ApplyTransactions(block *Block, txs []*Transaction) {
...
@@ -128,9 +128,9 @@ func (sm *StateManager) ApplyTransactions(block *Block, txs []*Transaction) {
// The prepare function, prepares the state manager for the next
// The prepare function, prepares the state manager for the next
// "ProcessBlock" action.
// "ProcessBlock" action.
func
(
sm
*
StateManager
)
Prepare
(
process
e
r
*
State
,
comparative
*
State
)
{
func
(
sm
*
StateManager
)
Prepare
(
process
o
r
*
State
,
comparative
*
State
)
{
sm
.
compState
=
comparative
sm
.
compState
=
comparative
sm
.
procState
=
process
e
r
sm
.
procState
=
process
o
r
}
}
// Default prepare function
// Default prepare function
...
...
ethchain/transaction.go
View file @
7277c420
...
@@ -116,8 +116,9 @@ func (tx *Transaction) RlpData() interface{} {
...
@@ -116,8 +116,9 @@ func (tx *Transaction) RlpData() interface{} {
if
!
tx
.
contractCreation
{
if
!
tx
.
contractCreation
{
data
=
append
(
data
,
tx
.
Recipient
,
tx
.
Gas
)
data
=
append
(
data
,
tx
.
Recipient
,
tx
.
Gas
)
}
}
d
:=
ethutil
.
NewSliceValue
(
tx
.
Data
)
.
Slice
()
return
append
(
data
,
ethutil
.
NewSliceValue
(
tx
.
Data
)
.
Slice
()
,
tx
.
v
,
tx
.
r
,
tx
.
s
)
return
append
(
data
,
d
,
tx
.
v
,
tx
.
r
,
tx
.
s
)
}
}
func
(
tx
*
Transaction
)
RlpValue
()
*
ethutil
.
Value
{
func
(
tx
*
Transaction
)
RlpValue
()
*
ethutil
.
Value
{
...
...
ethchain/vm.go
View file @
7277c420
...
@@ -115,6 +115,8 @@ func (vm *Vm) RunClosure(closure *Closure) []byte {
...
@@ -115,6 +115,8 @@ func (vm *Vm) RunClosure(closure *Closure) []byte {
}
}
if
closure
.
Gas
.
Cmp
(
gas
)
<
0
{
if
closure
.
Gas
.
Cmp
(
gas
)
<
0
{
ethutil
.
Config
.
Log
.
Debugln
(
"Insufficient gas"
,
closure
.
Gas
,
gas
)
return
closure
.
Return
(
nil
)
return
closure
.
Return
(
nil
)
}
}
...
...
ethchain/vm_test.go
View file @
7277c420
...
@@ -94,9 +94,7 @@ func TestRun4(t *testing.T) {
...
@@ -94,9 +94,7 @@ func TestRun4(t *testing.T) {
}
}
store[0] = 20
store[0] = 20
test = store[0]
store[a] = 20
store[a] = 20
f = store[400]
`
),
false
)
`
),
false
)
if
err
!=
nil
{
if
err
!=
nil
{
fmt
.
Println
(
err
)
fmt
.
Println
(
err
)
...
...
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