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
b608a80e
Commit
b608a80e
authored
Jan 19, 2014
by
obscuren
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
More opcodes
parent
489576b6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
0 deletions
+26
-0
block_manager.go
block_manager.go
+26
-0
No files found.
block_manager.go
View file @
b608a80e
...
...
@@ -524,7 +524,16 @@ out:
case
oIND
:
bm
.
stack
.
Push
(
big
.
NewInt
(
int64
(
pc
)))
case
oEXTRO
:
memAddr
:=
bm
.
stack
.
Pop
()
contractAddr
:=
bm
.
stack
.
Pop
()
.
Bytes
()
// Push the contract's memory on to the stack
bm
.
stack
.
Push
(
getContractMemory
(
block
,
contractAddr
,
memAddr
))
case
oBALANCE
:
// Pushes the balance of the popped value on to the stack
d
:=
block
.
State
()
.
Get
(
bm
.
stack
.
Pop
()
.
String
())
ether
:=
ethutil
.
NewEtherFromData
([]
byte
(
d
))
bm
.
stack
.
Push
(
ether
.
Amount
)
case
oMKTX
:
case
oSUICIDE
:
}
...
...
@@ -533,3 +542,20 @@ out:
bm
.
stack
.
Print
()
}
// Returns an address from the specified contract's address
func
getContractMemory
(
block
*
ethutil
.
Block
,
contractAddr
[]
byte
,
memAddr
*
big
.
Int
)
*
big
.
Int
{
contract
:=
block
.
GetContract
(
contractAddr
)
if
contract
==
nil
{
log
.
Panicf
(
"invalid contract addr %x"
,
contractAddr
)
}
val
:=
contract
.
State
()
.
Get
(
memAddr
.
String
())
// decode the object as a big integer
decoder
:=
ethutil
.
NewRlpDecoder
([]
byte
(
val
))
if
decoder
.
IsNil
()
{
return
ethutil
.
BigFalse
}
return
decoder
.
AsBigInt
()
}
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