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
c51db4c9
Commit
c51db4c9
authored
Aug 08, 2014
by
obscuren
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed stack issue
parent
3fc24013
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
17 deletions
+17
-17
state_manager.go
ethchain/state_manager.go
+4
-3
config.go
ethpipe/config.go
+0
-1
stack.go
ethvm/stack.go
+1
-1
vm.go
ethvm/vm.go
+12
-12
No files found.
ethchain/state_manager.go
View file @
c51db4c9
...
@@ -4,15 +4,16 @@ import (
...
@@ -4,15 +4,16 @@ import (
"bytes"
"bytes"
"container/list"
"container/list"
"fmt"
"fmt"
"math/big"
"sync"
"time"
"github.com/ethereum/eth-go/ethcrypto"
"github.com/ethereum/eth-go/ethcrypto"
"github.com/ethereum/eth-go/ethlog"
"github.com/ethereum/eth-go/ethlog"
"github.com/ethereum/eth-go/ethreact"
"github.com/ethereum/eth-go/ethreact"
"github.com/ethereum/eth-go/ethstate"
"github.com/ethereum/eth-go/ethstate"
"github.com/ethereum/eth-go/ethutil"
"github.com/ethereum/eth-go/ethutil"
"github.com/ethereum/eth-go/ethwire"
"github.com/ethereum/eth-go/ethwire"
"math/big"
"sync"
"time"
)
)
var
statelogger
=
ethlog
.
NewLogger
(
"STATE"
)
var
statelogger
=
ethlog
.
NewLogger
(
"STATE"
)
...
...
ethpipe/config.go
View file @
c51db4c9
...
@@ -18,7 +18,6 @@ func (self *Config) Get(name string) *Object {
...
@@ -18,7 +18,6 @@ func (self *Config) Get(name string) *Object {
case
"DnsReg"
:
case
"DnsReg"
:
objectAddr
:=
configCtrl
.
GetStorage
(
ethutil
.
BigD
([]
byte
{
0
}))
objectAddr
:=
configCtrl
.
GetStorage
(
ethutil
.
BigD
([]
byte
{
0
}))
domainAddr
:=
(
&
Object
{
self
.
pipe
.
World
()
.
safeGet
(
objectAddr
.
Bytes
())})
.
StorageString
(
"DnsReg"
)
.
Bytes
()
domainAddr
:=
(
&
Object
{
self
.
pipe
.
World
()
.
safeGet
(
objectAddr
.
Bytes
())})
.
StorageString
(
"DnsReg"
)
.
Bytes
()
return
&
Object
{
self
.
pipe
.
World
()
.
safeGet
(
domainAddr
)}
return
&
Object
{
self
.
pipe
.
World
()
.
safeGet
(
domainAddr
)}
default
:
default
:
addr
=
ethutil
.
RightPadBytes
([]
byte
(
name
),
32
)
addr
=
ethutil
.
RightPadBytes
([]
byte
(
name
),
32
)
...
...
ethvm/stack.go
View file @
c51db4c9
...
@@ -59,7 +59,7 @@ func (st *Stack) Peek() *big.Int {
...
@@ -59,7 +59,7 @@ func (st *Stack) Peek() *big.Int {
}
}
func
(
st
*
Stack
)
Peekn
()
(
*
big
.
Int
,
*
big
.
Int
)
{
func
(
st
*
Stack
)
Peekn
()
(
*
big
.
Int
,
*
big
.
Int
)
{
ints
:=
st
.
data
[
:
2
]
ints
:=
st
.
data
[
len
(
st
.
data
)
-
2
:
]
return
ints
[
0
],
ints
[
1
]
return
ints
[
0
],
ints
[
1
]
}
}
...
...
ethvm/vm.go
View file @
c51db4c9
...
@@ -129,14 +129,14 @@ func (self *Vm) RunClosure(closure *Closure) (ret []byte, err error) {
...
@@ -129,14 +129,14 @@ func (self *Vm) RunClosure(closure *Closure) (ret []byte, err error) {
fmt.Printf("%x %x\n", new(big.Int).SetBytes([]byte(key)).Bytes(), value.Bytes())
fmt.Printf("%x %x\n", new(big.Int).SetBytes([]byte(key)).Bytes(), value.Bytes())
})
})
}
}
*/
b := pc.Bytes()
b
:=
pc
.
Bytes
()
if len(b) == 0 {
if
len
(
b
)
==
0
{
b = []byte{0}
b
=
[]
byte
{
0
}
}
}
fmt.Printf("%x %x %x %x\n", closure.Address(), b, []byte{byte(op)}, closure.Gas.Bytes())
fmt
.
Printf
(
"%x %x %x %x
\n
"
,
closure
.
Address
(),
b
,
[]
byte
{
byte
(
op
)},
closure
.
Gas
.
Bytes
())
*/
}
}
gas
:=
new
(
big
.
Int
)
gas
:=
new
(
big
.
Int
)
...
@@ -856,12 +856,12 @@ func (self *Vm) Endl() *Vm {
...
@@ -856,12 +856,12 @@ func (self *Vm) Endl() *Vm {
}
}
func
ensure256
(
x
*
big
.
Int
)
{
func
ensure256
(
x
*
big
.
Int
)
{
maxInt
,
_
:=
new
(
big
.
Int
)
.
SetString
(
"115792089237316195423570985008687907853269984665640564039457584007913129639935
"
,
0
)
//max, _ := big.NewInt(0).SetString("115792089237316195423570985008687907853269984665640564039457584007913129639936
", 0)
if
x
.
Cmp
(
maxInt
)
>=
0
{
//if x.Cmp(max
) >= 0 {
x
.
SetInt64
(
0
)
d
:=
big
.
NewInt
(
1
)
d
.
Lsh
(
d
,
256
)
.
Sub
(
d
,
big
.
NewInt
(
1
))
return
x
.
And
(
x
,
d
)
}
//
}
// Could have done this with an OR, but big ints are costly.
// Could have done this with an OR, but big ints are costly.
...
...
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