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
9008b155
Commit
9008b155
authored
Dec 04, 2014
by
obscuren
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Renamed `chain` => `core`
parent
b6cb5272
Changes
45
Hide whitespace changes
Inline
Side-by-side
Showing
45 changed files
with
112 additions
and
160 deletions
+112
-160
block_pool.go
block_pool.go
+1
-1
bindings.go
cmd/mist/bindings.go
+2
-1
debugger.go
cmd/mist/debugger.go
+2
-2
ext_app.go
cmd/mist/ext_app.go
+7
-7
gui.go
cmd/mist/gui.go
+8
-8
html_container.go
cmd/mist/html_container.go
+2
-1
qml_container.go
cmd/mist/qml_container.go
+2
-1
ui_lib.go
cmd/mist/ui_lib.go
+3
-3
vm_env.go
cmd/utils/vm_env.go
+4
-4
.gitignore
core/.gitignore
+0
-0
asm.go
core/asm.go
+1
-1
block_manager.go
core/block_manager.go
+2
-2
chain_manager.go
core/chain_manager.go
+2
-2
chain_manager_test.go
core/chain_manager_test.go
+1
-1
dagger.go
core/dagger.go
+2
-2
dagger_test.go
core/dagger_test.go
+1
-1
error.go
core/error.go
+1
-1
events.go
core/events.go
+2
-2
execution.go
core/execution.go
+1
-1
fees.go
core/fees.go
+1
-1
filter.go
core/filter.go
+2
-2
filter_test.go
core/filter_test.go
+1
-1
genesis.go
core/genesis.go
+1
-1
helper_test.go
core/helper_test.go
+1
-1
state_transition.go
core/state_transition.go
+2
-2
transaction_pool.go
core/transaction_pool.go
+2
-2
block.go
core/types/block.go
+0
-0
bloom9.go
core/types/bloom9.go
+0
-0
bloom9_test.go
core/types/bloom9_test.go
+0
-0
common.go
core/types/common.go
+0
-0
derive_sha.go
core/types/derive_sha.go
+0
-0
receipt.go
core/types/receipt.go
+0
-0
transaction.go
core/types/transaction.go
+0
-0
transaction_test.go
core/types/transaction_test.go
+0
-0
vm_env.go
core/vm_env.go
+2
-2
ethereum.go
ethereum.go
+16
-16
javascript_runtime.go
javascript/javascript_runtime.go
+3
-3
miner.go
miner/miner.go
+8
-8
peer.go
peer.go
+1
-1
filter.go
ui/filter.go
+6
-6
filter.go
ui/qt/filter.go
+3
-3
hexface.go
xeth/hexface.go
+4
-55
js_types.go
xeth/js_types.go
+5
-5
pipe.go
xeth/pipe.go
+6
-6
vm_env.go
xeth/vm_env.go
+4
-4
No files found.
block_pool.go
View file @
9008b155
...
...
@@ -9,7 +9,7 @@ import (
"sync"
"time"
"github.com/ethereum/go-ethereum/c
hain
/types"
"github.com/ethereum/go-ethereum/c
ore
/types"
"github.com/ethereum/go-ethereum/ethutil"
"github.com/ethereum/go-ethereum/logger"
"github.com/ethereum/go-ethereum/wire"
...
...
cmd/mist/bindings.go
View file @
9008b155
...
...
@@ -21,8 +21,9 @@ import (
"encoding/json"
"os"
"strconv"
"github.com/ethereum/go-ethereum/chain/types"
"github.com/ethereum/go-ethereum/cmd/utils"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/ethutil"
"github.com/ethereum/go-ethereum/logger"
)
...
...
cmd/mist/debugger.go
View file @
9008b155
...
...
@@ -24,8 +24,8 @@ import (
"strings"
"unicode"
"github.com/ethereum/go-ethereum/chain"
"github.com/ethereum/go-ethereum/cmd/utils"
"github.com/ethereum/go-ethereum/core"
"github.com/ethereum/go-ethereum/ethutil"
"github.com/ethereum/go-ethereum/state"
"github.com/ethereum/go-ethereum/vm"
...
...
@@ -81,7 +81,7 @@ func (self *DebuggerWindow) SetData(data string) {
func
(
self
*
DebuggerWindow
)
SetAsm
(
data
[]
byte
)
{
self
.
win
.
Root
()
.
Call
(
"clearAsm"
)
dis
:=
c
hain
.
Disassemble
(
data
)
dis
:=
c
ore
.
Disassemble
(
data
)
for
_
,
str
:=
range
dis
{
self
.
win
.
Root
()
.
Call
(
"setAsm"
,
str
)
}
...
...
cmd/mist/ext_app.go
View file @
9008b155
...
...
@@ -20,8 +20,8 @@ package main
import
(
"encoding/json"
"github.com/ethereum/go-ethereum/c
hain
"
"github.com/ethereum/go-ethereum/c
hain
/types"
"github.com/ethereum/go-ethereum/c
ore
"
"github.com/ethereum/go-ethereum/c
ore
/types"
"github.com/ethereum/go-ethereum/event"
"github.com/ethereum/go-ethereum/javascript"
"github.com/ethereum/go-ethereum/state"
...
...
@@ -45,12 +45,12 @@ type AppContainer interface {
type
ExtApplication
struct
{
*
xeth
.
JSXEth
eth
c
hain
.
EthManager
eth
c
ore
.
EthManager
events
event
.
Subscription
watcherQuitChan
chan
bool
filters
map
[
string
]
*
c
hain
.
Filter
filters
map
[
string
]
*
c
ore
.
Filter
container
AppContainer
lib
*
UiLib
...
...
@@ -61,7 +61,7 @@ func NewExtApplication(container AppContainer, lib *UiLib) *ExtApplication {
JSXEth
:
xeth
.
NewJSXEth
(
lib
.
eth
),
eth
:
lib
.
eth
,
watcherQuitChan
:
make
(
chan
bool
),
filters
:
make
(
map
[
string
]
*
c
hain
.
Filter
),
filters
:
make
(
map
[
string
]
*
c
ore
.
Filter
),
container
:
container
,
lib
:
lib
,
}
...
...
@@ -81,7 +81,7 @@ func (app *ExtApplication) run() {
// Subscribe to events
mux
:=
app
.
lib
.
eth
.
EventMux
()
app
.
events
=
mux
.
Subscribe
(
c
hain
.
NewBlockEvent
{},
state
.
Messages
(
nil
))
app
.
events
=
mux
.
Subscribe
(
c
ore
.
NewBlockEvent
{},
state
.
Messages
(
nil
))
// Call the main loop
go
app
.
mainLoop
()
...
...
@@ -107,7 +107,7 @@ func (app *ExtApplication) stop() {
func
(
app
*
ExtApplication
)
mainLoop
()
{
for
ev
:=
range
app
.
events
.
Chan
()
{
switch
ev
:=
ev
.
(
type
)
{
case
c
hain
.
NewBlockEvent
:
case
c
ore
.
NewBlockEvent
:
app
.
container
.
NewBlock
(
ev
.
Block
)
case
state
.
Messages
:
...
...
cmd/mist/gui.go
View file @
9008b155
...
...
@@ -31,8 +31,8 @@ import (
"time"
"github.com/ethereum/go-ethereum"
"github.com/ethereum/go-ethereum/c
hain
"
"github.com/ethereum/go-ethereum/c
hain
/types"
"github.com/ethereum/go-ethereum/c
ore
"
"github.com/ethereum/go-ethereum/c
ore
/types"
"github.com/ethereum/go-ethereum/ethdb"
"github.com/ethereum/go-ethereum/ethutil"
"github.com/ethereum/go-ethereum/logger"
...
...
@@ -413,9 +413,9 @@ func (gui *Gui) update() {
events
:=
gui
.
eth
.
EventMux
()
.
Subscribe
(
eth
.
ChainSyncEvent
{},
eth
.
PeerListEvent
{},
c
hain
.
NewBlockEvent
{},
c
hain
.
TxPreEvent
{},
c
hain
.
TxPostEvent
{},
c
ore
.
NewBlockEvent
{},
c
ore
.
TxPreEvent
{},
c
ore
.
TxPostEvent
{},
)
// nameReg := gui.pipe.World().Config().Get("NameReg")
...
...
@@ -430,13 +430,13 @@ func (gui *Gui) update() {
return
}
switch
ev
:=
ev
.
(
type
)
{
case
c
hain
.
NewBlockEvent
:
case
c
ore
.
NewBlockEvent
:
gui
.
processBlock
(
ev
.
Block
,
false
)
if
bytes
.
Compare
(
ev
.
Block
.
Coinbase
,
gui
.
address
())
==
0
{
gui
.
setWalletValue
(
gui
.
eth
.
BlockManager
()
.
CurrentState
()
.
GetAccount
(
gui
.
address
())
.
Balance
(),
nil
)
}
case
c
hain
.
TxPreEvent
:
case
c
ore
.
TxPreEvent
:
tx
:=
ev
.
Tx
object
:=
state
.
GetAccount
(
gui
.
address
())
...
...
@@ -449,7 +449,7 @@ func (gui *Gui) update() {
gui
.
setWalletValue
(
object
.
Balance
(),
unconfirmedFunds
)
gui
.
insertTransaction
(
"pre"
,
tx
)
case
c
hain
.
TxPostEvent
:
case
c
ore
.
TxPostEvent
:
tx
:=
ev
.
Tx
object
:=
state
.
GetAccount
(
gui
.
address
())
...
...
cmd/mist/html_container.go
View file @
9008b155
...
...
@@ -26,7 +26,8 @@ import (
"os"
"path"
"path/filepath"
"github.com/ethereum/go-ethereum/chain/types"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/ethutil"
"github.com/ethereum/go-ethereum/javascript"
"github.com/ethereum/go-ethereum/state"
...
...
cmd/mist/qml_container.go
View file @
9008b155
...
...
@@ -20,7 +20,8 @@ package main
import
(
"fmt"
"runtime"
"github.com/ethereum/go-ethereum/chain/types"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/ethutil"
"github.com/ethereum/go-ethereum/state"
"github.com/ethereum/go-ethereum/xeth"
...
...
cmd/mist/ui_lib.go
View file @
9008b155
...
...
@@ -25,8 +25,8 @@ import (
"strings"
"github.com/ethereum/go-ethereum"
"github.com/ethereum/go-ethereum/c
hain
"
"github.com/ethereum/go-ethereum/c
hain
/types"
"github.com/ethereum/go-ethereum/c
ore
"
"github.com/ethereum/go-ethereum/c
ore
/types"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/ethutil"
"github.com/ethereum/go-ethereum/javascript"
...
...
@@ -231,7 +231,7 @@ func (self *UiLib) NewFilter(object map[string]interface{}) (id int) {
}
func
(
self
*
UiLib
)
NewFilterString
(
typ
string
)
(
id
int
)
{
filter
:=
c
hain
.
NewFilter
(
self
.
eth
)
filter
:=
c
ore
.
NewFilter
(
self
.
eth
)
filter
.
BlockCallback
=
func
(
block
*
types
.
Block
)
{
if
self
.
win
!=
nil
&&
self
.
win
.
Root
()
!=
nil
{
self
.
win
.
Root
()
.
Call
(
"invokeFilterCallback"
,
"{}"
,
id
)
...
...
cmd/utils/vm_env.go
View file @
9008b155
...
...
@@ -3,8 +3,8 @@ package utils
import
(
"math/big"
"github.com/ethereum/go-ethereum/c
hain
"
"github.com/ethereum/go-ethereum/c
hain
/types"
"github.com/ethereum/go-ethereum/c
ore
"
"github.com/ethereum/go-ethereum/c
ore
/types"
"github.com/ethereum/go-ethereum/state"
"github.com/ethereum/go-ethereum/vm"
)
...
...
@@ -48,10 +48,10 @@ func (self *VMEnv) Transfer(from, to vm.Account, amount *big.Int) error {
return
vm
.
Transfer
(
from
,
to
,
amount
)
}
func
(
self
*
VMEnv
)
vm
(
addr
,
data
[]
byte
,
gas
,
price
,
value
*
big
.
Int
)
*
c
hain
.
Execution
{
func
(
self
*
VMEnv
)
vm
(
addr
,
data
[]
byte
,
gas
,
price
,
value
*
big
.
Int
)
*
c
ore
.
Execution
{
evm
:=
vm
.
New
(
self
,
vm
.
DebugVmTy
)
return
c
hain
.
NewExecution
(
evm
,
addr
,
data
,
gas
,
price
,
value
)
return
c
ore
.
NewExecution
(
evm
,
addr
,
data
,
gas
,
price
,
value
)
}
func
(
self
*
VMEnv
)
Call
(
caller
vm
.
ClosureRef
,
addr
,
data
[]
byte
,
gas
,
price
,
value
*
big
.
Int
)
([]
byte
,
error
)
{
...
...
c
hain
/.gitignore
→
c
ore
/.gitignore
View file @
9008b155
File moved
c
hain
/asm.go
→
c
ore
/asm.go
View file @
9008b155
package
c
hain
package
c
ore
import
(
"fmt"
...
...
c
hain
/block_manager.go
→
c
ore
/block_manager.go
View file @
9008b155
package
c
hain
package
c
ore
import
(
"bytes"
...
...
@@ -9,7 +9,7 @@ import (
"sync"
"time"
"github.com/ethereum/go-ethereum/c
hain
/types"
"github.com/ethereum/go-ethereum/c
ore
/types"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/ethutil"
"github.com/ethereum/go-ethereum/event"
...
...
c
hain
/chain_manager.go
→
c
ore
/chain_manager.go
View file @
9008b155
package
c
hain
package
c
ore
import
(
"fmt"
"math/big"
"github.com/ethereum/go-ethereum/c
hain
/types"
"github.com/ethereum/go-ethereum/c
ore
/types"
"github.com/ethereum/go-ethereum/ethutil"
"github.com/ethereum/go-ethereum/event"
"github.com/ethereum/go-ethereum/logger"
...
...
c
hain
/chain_manager_test.go
→
c
ore
/chain_manager_test.go
View file @
9008b155
package
c
hain
package
c
ore
import
(
"fmt"
...
...
c
hain
/dagger.go
→
c
ore
/dagger.go
View file @
9008b155
package
c
hain
package
c
ore
import
(
"hash"
...
...
@@ -6,7 +6,7 @@ import (
"math/rand"
"time"
"github.com/ethereum/go-ethereum/c
hain
/types"
"github.com/ethereum/go-ethereum/c
ore
/types"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/ethutil"
"github.com/ethereum/go-ethereum/logger"
...
...
c
hain
/dagger_test.go
→
c
ore
/dagger_test.go
View file @
9008b155
package
c
hain
package
c
ore
import
(
"math/big"
...
...
c
hain
/error.go
→
c
ore
/error.go
View file @
9008b155
package
c
hain
package
c
ore
import
(
"fmt"
...
...
c
hain
/events.go
→
c
ore
/events.go
View file @
9008b155
package
c
hain
package
c
ore
import
"github.com/ethereum/go-ethereum/c
hain
/types"
import
"github.com/ethereum/go-ethereum/c
ore
/types"
// TxPreEvent is posted when a transaction enters the transaction pool.
type
TxPreEvent
struct
{
Tx
*
types
.
Transaction
}
...
...
c
hain
/execution.go
→
c
ore
/execution.go
View file @
9008b155
package
c
hain
package
c
ore
import
(
"fmt"
...
...
c
hain
/fees.go
→
c
ore
/fees.go
View file @
9008b155
package
c
hain
package
c
ore
import
(
"math/big"
...
...
c
hain
/filter.go
→
c
ore
/filter.go
View file @
9008b155
package
c
hain
package
c
ore
import
(
"bytes"
"math"
"math/big"
"github.com/ethereum/go-ethereum/c
hain
/types"
"github.com/ethereum/go-ethereum/c
ore
/types"
"github.com/ethereum/go-ethereum/ethutil"
"github.com/ethereum/go-ethereum/state"
)
...
...
c
hain
/filter_test.go
→
c
ore
/filter_test.go
View file @
9008b155
package
c
hain
package
c
ore
// import "testing"
...
...
c
hain
/genesis.go
→
c
ore
/genesis.go
View file @
9008b155
package
c
hain
package
c
ore
import
(
"math/big"
...
...
c
hain
/helper_test.go
→
c
ore
/helper_test.go
View file @
9008b155
package
c
hain
package
c
ore
import
(
"container/list"
...
...
c
hain
/state_transition.go
→
c
ore
/state_transition.go
View file @
9008b155
package
c
hain
package
c
ore
import
(
"fmt"
"math/big"
"github.com/ethereum/go-ethereum/c
hain
/types"
"github.com/ethereum/go-ethereum/c
ore
/types"
"github.com/ethereum/go-ethereum/state"
"github.com/ethereum/go-ethereum/vm"
)
...
...
c
hain
/transaction_pool.go
→
c
ore
/transaction_pool.go
View file @
9008b155
package
c
hain
package
c
ore
import
(
"bytes"
...
...
@@ -7,7 +7,7 @@ import (
"math/big"
"sync"
"github.com/ethereum/go-ethereum/c
hain
/types"
"github.com/ethereum/go-ethereum/c
ore
/types"
"github.com/ethereum/go-ethereum/logger"
"github.com/ethereum/go-ethereum/state"
"github.com/ethereum/go-ethereum/wire"
...
...
c
hain
/types/block.go
→
c
ore
/types/block.go
View file @
9008b155
File moved
c
hain
/types/bloom9.go
→
c
ore
/types/bloom9.go
View file @
9008b155
File moved
c
hain
/types/bloom9_test.go
→
c
ore
/types/bloom9_test.go
View file @
9008b155
File moved
c
hain
/types/common.go
→
c
ore
/types/common.go
View file @
9008b155
File moved
c
hain
/types/derive_sha.go
→
c
ore
/types/derive_sha.go
View file @
9008b155
File moved
c
hain
/types/receipt.go
→
c
ore
/types/receipt.go
View file @
9008b155
File moved
c
hain
/types/transaction.go
→
c
ore
/types/transaction.go
View file @
9008b155
File moved
c
hain
/types/transaction_test.go
→
c
ore
/types/transaction_test.go
View file @
9008b155
File moved
c
hain
/vm_env.go
→
c
ore
/vm_env.go
View file @
9008b155
package
c
hain
package
c
ore
import
(
"math/big"
"github.com/ethereum/go-ethereum/c
hain
/types"
"github.com/ethereum/go-ethereum/c
ore
/types"
"github.com/ethereum/go-ethereum/state"
"github.com/ethereum/go-ethereum/vm"
)
...
...
ethereum.go
View file @
9008b155
...
...
@@ -14,7 +14,7 @@ import (
"sync/atomic"
"time"
"github.com/ethereum/go-ethereum/c
hain
"
"github.com/ethereum/go-ethereum/c
ore
"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/ethutil"
"github.com/ethereum/go-ethereum/event"
...
...
@@ -50,12 +50,12 @@ type Ethereum struct {
// DB interface
db
ethutil
.
Database
// State manager for processing new blocks and managing the over all states
blockManager
*
c
hain
.
BlockManager
blockManager
*
c
ore
.
BlockManager
// The transaction pool. Transaction can be pushed on this pool
// for later including in the blocks
txPool
*
c
hain
.
TxPool
txPool
*
c
ore
.
TxPool
// The canonical chain
blockChain
*
c
hain
.
ChainManager
blockChain
*
c
ore
.
ChainManager
// The block pool
blockPool
*
BlockPool
// Eventer
...
...
@@ -94,7 +94,7 @@ type Ethereum struct {
filterMu
sync
.
RWMutex
filterId
int
filters
map
[
int
]
*
c
hain
.
Filter
filters
map
[
int
]
*
c
ore
.
Filter
}
func
New
(
db
ethutil
.
Database
,
clientIdentity
wire
.
ClientIdentity
,
keyManager
*
crypto
.
KeyManager
,
caps
Caps
,
usePnp
bool
)
(
*
Ethereum
,
error
)
{
...
...
@@ -124,13 +124,13 @@ func New(db ethutil.Database, clientIdentity wire.ClientIdentity, keyManager *cr
keyManager
:
keyManager
,
clientIdentity
:
clientIdentity
,
isUpToDate
:
true
,
filters
:
make
(
map
[
int
]
*
c
hain
.
Filter
),
filters
:
make
(
map
[
int
]
*
c
ore
.
Filter
),
}
ethereum
.
blockPool
=
NewBlockPool
(
ethereum
)
ethereum
.
txPool
=
c
hain
.
NewTxPool
(
ethereum
)
ethereum
.
blockChain
=
c
hain
.
NewChainManager
(
ethereum
.
EventMux
())
ethereum
.
blockManager
=
c
hain
.
NewBlockManager
(
ethereum
)
ethereum
.
txPool
=
c
ore
.
NewTxPool
(
ethereum
)
ethereum
.
blockChain
=
c
ore
.
NewChainManager
(
ethereum
.
EventMux
())
ethereum
.
blockManager
=
c
ore
.
NewBlockManager
(
ethereum
)
ethereum
.
blockChain
.
SetProcessor
(
ethereum
.
blockManager
)
// Start the tx pool
...
...
@@ -147,15 +147,15 @@ func (s *Ethereum) ClientIdentity() wire.ClientIdentity {
return
s
.
clientIdentity
}
func
(
s
*
Ethereum
)
ChainManager
()
*
c
hain
.
ChainManager
{
func
(
s
*
Ethereum
)
ChainManager
()
*
c
ore
.
ChainManager
{
return
s
.
blockChain
}
func
(
s
*
Ethereum
)
BlockManager
()
*
c
hain
.
BlockManager
{
func
(
s
*
Ethereum
)
BlockManager
()
*
c
ore
.
BlockManager
{
return
s
.
blockManager
}
func
(
s
*
Ethereum
)
TxPool
()
*
c
hain
.
TxPool
{
func
(
s
*
Ethereum
)
TxPool
()
*
c
ore
.
TxPool
{
return
s
.
txPool
}
func
(
s
*
Ethereum
)
BlockPool
()
*
BlockPool
{
...
...
@@ -591,7 +591,7 @@ out:
// InstallFilter adds filter for blockchain events.
// The filter's callbacks will run for matching blocks and messages.
// The filter should not be modified after it has been installed.
func
(
self
*
Ethereum
)
InstallFilter
(
filter
*
c
hain
.
Filter
)
(
id
int
)
{
func
(
self
*
Ethereum
)
InstallFilter
(
filter
*
c
ore
.
Filter
)
(
id
int
)
{
self
.
filterMu
.
Lock
()
id
=
self
.
filterId
self
.
filters
[
id
]
=
filter
...
...
@@ -608,7 +608,7 @@ func (self *Ethereum) UninstallFilter(id int) {
// GetFilter retrieves a filter installed using InstallFilter.
// The filter may not be modified.
func
(
self
*
Ethereum
)
GetFilter
(
id
int
)
*
c
hain
.
Filter
{
func
(
self
*
Ethereum
)
GetFilter
(
id
int
)
*
c
ore
.
Filter
{
self
.
filterMu
.
RLock
()
defer
self
.
filterMu
.
RUnlock
()
return
self
.
filters
[
id
]
...
...
@@ -616,10 +616,10 @@ func (self *Ethereum) GetFilter(id int) *chain.Filter {
func
(
self
*
Ethereum
)
filterLoop
()
{
// Subscribe to events
events
:=
self
.
eventMux
.
Subscribe
(
c
hain
.
NewBlockEvent
{},
state
.
Messages
(
nil
))
events
:=
self
.
eventMux
.
Subscribe
(
c
ore
.
NewBlockEvent
{},
state
.
Messages
(
nil
))
for
event
:=
range
events
.
Chan
()
{
switch
event
:=
event
.
(
type
)
{
case
c
hain
.
NewBlockEvent
:
case
c
ore
.
NewBlockEvent
:
self
.
filterMu
.
RLock
()
for
_
,
filter
:=
range
self
.
filters
{
if
filter
.
BlockCallback
!=
nil
{
...
...
javascript/javascript_runtime.go
View file @
9008b155
...
...
@@ -8,9 +8,9 @@ import (
"path/filepath"
"github.com/ethereum/go-ethereum"
"github.com/ethereum/go-ethereum/chain"
"github.com/ethereum/go-ethereum/chain/types"
"github.com/ethereum/go-ethereum/cmd/utils"
"github.com/ethereum/go-ethereum/core"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/ethutil"
"github.com/ethereum/go-ethereum/event"
"github.com/ethereum/go-ethereum/logger"
...
...
@@ -63,7 +63,7 @@ func NewJSRE(ethereum *eth.Ethereum) *JSRE {
// Subscribe to events
mux
:=
ethereum
.
EventMux
()
re
.
events
=
mux
.
Subscribe
(
c
hain
.
NewBlockEvent
{})
re
.
events
=
mux
.
Subscribe
(
c
ore
.
NewBlockEvent
{})
// We have to make sure that, whoever calls this, calls "Stop"
go
re
.
mainLoop
()
...
...
miner/miner.go
View file @
9008b155
...
...
@@ -30,8 +30,8 @@ import (
"github.com/ethereum/go-ethereum"
"github.com/ethereum/go-ethereum/ethutil"
"github.com/ethereum/go-ethereum/c
hain
"
"github.com/ethereum/go-ethereum/c
hain
/types"
"github.com/ethereum/go-ethereum/c
ore
"
"github.com/ethereum/go-ethereum/c
ore
/types"
"github.com/ethereum/go-ethereum/event"
"github.com/ethereum/go-ethereum/logger"
"github.com/ethereum/go-ethereum/wire"
...
...
@@ -59,7 +59,7 @@ type Miner struct {
localTxs
map
[
int
]
*
LocalTx
localTxId
int
pow
c
hain
.
PoW
pow
c
ore
.
PoW
quitCh
chan
struct
{}
powQuitCh
chan
struct
{}
...
...
@@ -74,7 +74,7 @@ func New(coinbase []byte, eth *eth.Ethereum) *Miner {
return
&
Miner
{
eth
:
eth
,
powQuitCh
:
make
(
chan
struct
{}),
pow
:
&
c
hain
.
EasyPow
{},
pow
:
&
c
ore
.
EasyPow
{},
mining
:
false
,
localTxs
:
make
(
map
[
int
]
*
LocalTx
),
MinAcceptedGasPrice
:
big
.
NewInt
(
10000000000000
),
...
...
@@ -82,7 +82,7 @@ func New(coinbase []byte, eth *eth.Ethereum) *Miner {
}
}
func
(
self
*
Miner
)
GetPow
()
c
hain
.
PoW
{
func
(
self
*
Miner
)
GetPow
()
c
ore
.
PoW
{
return
self
.
pow
}
...
...
@@ -116,7 +116,7 @@ func (self *Miner) Start() {
self
.
powQuitCh
=
make
(
chan
struct
{})
mux
:=
self
.
eth
.
EventMux
()
self
.
events
=
mux
.
Subscribe
(
c
hain
.
NewBlockEvent
{},
chain
.
TxPreEvent
{},
&
LocalTx
{})
self
.
events
=
mux
.
Subscribe
(
c
ore
.
NewBlockEvent
{},
core
.
TxPreEvent
{},
&
LocalTx
{})
go
self
.
update
()
go
self
.
mine
()
...
...
@@ -147,7 +147,7 @@ out:
select
{
case
event
:=
<-
self
.
events
.
Chan
()
:
switch
event
:=
event
.
(
type
)
{
case
c
hain
.
NewBlockEvent
:
case
c
ore
.
NewBlockEvent
:
block
:=
event
.
Block
if
self
.
eth
.
ChainManager
()
.
HasBlock
(
block
.
Hash
())
{
self
.
reset
()
...
...
@@ -156,7 +156,7 @@ out:
}
else
if
true
{
// do uncle stuff
}
case
c
hain
.
TxPreEvent
,
*
LocalTx
:
case
c
ore
.
TxPreEvent
,
*
LocalTx
:
self
.
reset
()
go
self
.
mine
()
}
...
...
peer.go
View file @
9008b155
...
...
@@ -12,7 +12,7 @@ import (
"sync/atomic"
"time"
"github.com/ethereum/go-ethereum/c
hain
/types"
"github.com/ethereum/go-ethereum/c
ore
/types"
"github.com/ethereum/go-ethereum/ethutil"
"github.com/ethereum/go-ethereum/logger"
"github.com/ethereum/go-ethereum/wire"
...
...
ui/filter.go
View file @
9008b155
package
ui
import
(
"github.com/ethereum/go-ethereum/c
hain
"
"github.com/ethereum/go-ethereum/c
ore
"
"github.com/ethereum/go-ethereum/ethutil"
)
func
NewFilterFromMap
(
object
map
[
string
]
interface
{},
eth
c
hain
.
EthManager
)
*
chain
.
Filter
{
filter
:=
c
hain
.
NewFilter
(
eth
)
func
NewFilterFromMap
(
object
map
[
string
]
interface
{},
eth
c
ore
.
EthManager
)
*
core
.
Filter
{
filter
:=
c
ore
.
NewFilter
(
eth
)
if
object
[
"earliest"
]
!=
nil
{
val
:=
ethutil
.
NewValue
(
object
[
"earliest"
])
...
...
@@ -46,7 +46,7 @@ func NewFilterFromMap(object map[string]interface{}, eth chain.EthManager) *chai
}
// Conversion methodn
func
mapToAccountChange
(
m
map
[
string
]
interface
{})
(
d
c
hain
.
AccountChange
)
{
func
mapToAccountChange
(
m
map
[
string
]
interface
{})
(
d
c
ore
.
AccountChange
)
{
if
str
,
ok
:=
m
[
"id"
]
.
(
string
);
ok
{
d
.
Address
=
ethutil
.
Hex2Bytes
(
str
)
}
...
...
@@ -60,9 +60,9 @@ func mapToAccountChange(m map[string]interface{}) (d chain.AccountChange) {
// data can come in in the following formats:
// ["aabbccdd", {id: "ccddee", at: "11223344"}], "aabbcc", {id: "ccddee", at: "1122"}
func
makeAltered
(
v
interface
{})
(
d
[]
c
hain
.
AccountChange
)
{
func
makeAltered
(
v
interface
{})
(
d
[]
c
ore
.
AccountChange
)
{
if
str
,
ok
:=
v
.
(
string
);
ok
{
d
=
append
(
d
,
c
hain
.
AccountChange
{
ethutil
.
Hex2Bytes
(
str
),
nil
})
d
=
append
(
d
,
c
ore
.
AccountChange
{
ethutil
.
Hex2Bytes
(
str
),
nil
})
}
else
if
obj
,
ok
:=
v
.
(
map
[
string
]
interface
{});
ok
{
d
=
append
(
d
,
mapToAccountChange
(
obj
))
}
else
if
slice
,
ok
:=
v
.
([]
interface
{});
ok
{
...
...
ui/qt/filter.go
View file @
9008b155
...
...
@@ -3,12 +3,12 @@ package qt
import
(
"fmt"
"github.com/ethereum/go-ethereum/c
hain
"
"github.com/ethereum/go-ethereum/c
ore
"
"github.com/ethereum/go-ethereum/ui"
"gopkg.in/qml.v1"
)
func
NewFilterFromMap
(
object
map
[
string
]
interface
{},
eth
c
hain
.
EthManager
)
*
chain
.
Filter
{
func
NewFilterFromMap
(
object
map
[
string
]
interface
{},
eth
c
ore
.
EthManager
)
*
core
.
Filter
{
filter
:=
ui
.
NewFilterFromMap
(
object
,
eth
)
if
object
[
"altered"
]
!=
nil
{
...
...
@@ -18,7 +18,7 @@ func NewFilterFromMap(object map[string]interface{}, eth chain.EthManager) *chai
return
filter
}
func
makeAltered
(
v
interface
{})
(
d
[]
c
hain
.
AccountChange
)
{
func
makeAltered
(
v
interface
{})
(
d
[]
c
ore
.
AccountChange
)
{
if
qList
,
ok
:=
v
.
(
*
qml
.
List
);
ok
{
var
s
[]
interface
{}
qList
.
Convert
(
&
s
)
...
...
xeth/hexface.go
View file @
9008b155
...
...
@@ -5,8 +5,8 @@ import (
"encoding/json"
"sync/atomic"
"github.com/ethereum/go-ethereum/c
hain
"
"github.com/ethereum/go-ethereum/c
hain
/types"
"github.com/ethereum/go-ethereum/c
ore
"
"github.com/ethereum/go-ethereum/c
ore
/types"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/ethutil"
"github.com/ethereum/go-ethereum/state"
...
...
@@ -16,7 +16,7 @@ type JSXEth struct {
*
XEth
}
func
NewJSXEth
(
eth
c
hain
.
EthManager
)
*
JSXEth
{
func
NewJSXEth
(
eth
c
ore
.
EthManager
)
*
JSXEth
{
return
&
JSXEth
{
New
(
eth
)}
}
...
...
@@ -64,7 +64,7 @@ func (self *JSXEth) PeerCount() int {
func
(
self
*
JSXEth
)
Peers
()
[]
JSPeer
{
var
peers
[]
JSPeer
for
peer
:=
self
.
obj
.
Peers
()
.
Front
();
peer
!=
nil
;
peer
=
peer
.
Next
()
{
p
:=
peer
.
Value
.
(
c
hain
.
Peer
)
p
:=
peer
.
Value
.
(
c
ore
.
Peer
)
// we only want connected peers
if
atomic
.
LoadInt32
(
p
.
Connected
())
!=
0
{
peers
=
append
(
peers
,
*
NewJSPeer
(
p
))
...
...
@@ -220,57 +220,6 @@ func (self *JSXEth) Transact(key, toStr, valueStr, gasStr, gasPriceStr, codeStr
}
return
ethutil
.
Bytes2Hex
(
tx
.
Hash
()),
nil
/*
var hash []byte
var contractCreation bool
if len(toStr) == 0 {
contractCreation = true
} else {
// Check if an address is stored by this address
addr := self.World().Config().Get("NameReg").StorageString(toStr).Bytes()
if len(addr) > 0 {
hash = addr
} else {
hash = ethutil.Hex2Bytes(toStr)
}
}
var (
value = ethutil.Big(valueStr)
gas = ethutil.Big(gasStr)
gasPrice = ethutil.Big(gasPriceStr)
data []byte
tx *chain.Transaction
)
if ethutil.IsHex(codeStr) {
data = ethutil.Hex2Bytes(codeStr[2:])
} else {
data = ethutil.Hex2Bytes(codeStr)
}
if contractCreation {
tx = chain.NewContractCreationTx(value, gas, gasPrice, data)
} else {
tx = chain.NewTransactionMessage(hash, value, gas, gasPrice, data)
}
acc := self.obj.BlockManager().TransState().GetOrNewStateObject(keyPair.Address())
tx.Nonce = acc.Nonce
acc.Nonce += 1
self.obj.BlockManager().TransState().UpdateStateObject(acc)
tx.Sign(keyPair.PrivateKey)
self.obj.TxPool().QueueTransaction(tx)
if contractCreation {
pipelogger.Infof("Contract addr %x", tx.CreationAddress(self.World().State()))
}
return NewJSReciept(contractCreation, tx.CreationAddress(self.World().State()), tx.Hash(), keyPair.Address()), nil
*/
}
func
(
self
*
JSXEth
)
PushTx
(
txStr
string
)
(
*
JSReceipt
,
error
)
{
...
...
xeth/js_types.go
View file @
9008b155
...
...
@@ -5,8 +5,8 @@ import (
"strconv"
"strings"
"github.com/ethereum/go-ethereum/c
hain
"
"github.com/ethereum/go-ethereum/c
hain
/types"
"github.com/ethereum/go-ethereum/c
ore
"
"github.com/ethereum/go-ethereum/c
ore
/types"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/ethutil"
"github.com/ethereum/go-ethereum/state"
...
...
@@ -106,7 +106,7 @@ func NewJSTx(tx *types.Transaction, state *state.State) *JSTransaction {
var
data
string
if
tx
.
CreatesContract
()
{
data
=
strings
.
Join
(
c
hain
.
Disassemble
(
tx
.
Data
),
"
\n
"
)
data
=
strings
.
Join
(
c
ore
.
Disassemble
(
tx
.
Data
),
"
\n
"
)
}
else
{
data
=
ethutil
.
Bytes2Hex
(
tx
.
Data
)
}
...
...
@@ -155,7 +155,7 @@ func NewPReciept(contractCreation bool, creationAddress, hash, address []byte) *
// Peer interface exposed to QML
type
JSPeer
struct
{
ref
*
c
hain
.
Peer
ref
*
c
ore
.
Peer
Inbound
bool
`json:"isInbound"`
LastSend
int64
`json:"lastSend"`
LastPong
int64
`json:"lastPong"`
...
...
@@ -167,7 +167,7 @@ type JSPeer struct {
Caps
string
`json:"caps"`
}
func
NewJSPeer
(
peer
c
hain
.
Peer
)
*
JSPeer
{
func
NewJSPeer
(
peer
c
ore
.
Peer
)
*
JSPeer
{
if
peer
==
nil
{
return
nil
}
...
...
xeth/pipe.go
View file @
9008b155
...
...
@@ -5,8 +5,8 @@ package xeth
*/
import
(
"github.com/ethereum/go-ethereum/c
hain
"
"github.com/ethereum/go-ethereum/c
hain
/types"
"github.com/ethereum/go-ethereum/c
ore
"
"github.com/ethereum/go-ethereum/c
ore
/types"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/ethutil"
"github.com/ethereum/go-ethereum/logger"
...
...
@@ -20,15 +20,15 @@ type VmVars struct {
}
type
XEth
struct
{
obj
c
hain
.
EthManager
blockManager
*
c
hain
.
BlockManager
blockChain
*
c
hain
.
ChainManager
obj
c
ore
.
EthManager
blockManager
*
c
ore
.
BlockManager
blockChain
*
c
ore
.
ChainManager
world
*
World
Vm
VmVars
}
func
New
(
obj
c
hain
.
EthManager
)
*
XEth
{
func
New
(
obj
c
ore
.
EthManager
)
*
XEth
{
pipe
:=
&
XEth
{
obj
:
obj
,
blockManager
:
obj
.
BlockManager
(),
...
...
xeth/vm_env.go
View file @
9008b155
...
...
@@ -3,8 +3,8 @@ package xeth
import
(
"math/big"
"github.com/ethereum/go-ethereum/c
hain
"
"github.com/ethereum/go-ethereum/c
hain
/types"
"github.com/ethereum/go-ethereum/c
ore
"
"github.com/ethereum/go-ethereum/c
ore
/types"
"github.com/ethereum/go-ethereum/state"
"github.com/ethereum/go-ethereum/vm"
)
...
...
@@ -46,10 +46,10 @@ func (self *VMEnv) Transfer(from, to vm.Account, amount *big.Int) error {
return
vm
.
Transfer
(
from
,
to
,
amount
)
}
func
(
self
*
VMEnv
)
vm
(
addr
,
data
[]
byte
,
gas
,
price
,
value
*
big
.
Int
)
*
c
hain
.
Execution
{
func
(
self
*
VMEnv
)
vm
(
addr
,
data
[]
byte
,
gas
,
price
,
value
*
big
.
Int
)
*
c
ore
.
Execution
{
evm
:=
vm
.
New
(
self
,
vm
.
DebugVmTy
)
return
c
hain
.
NewExecution
(
evm
,
addr
,
data
,
gas
,
price
,
value
)
return
c
ore
.
NewExecution
(
evm
,
addr
,
data
,
gas
,
price
,
value
)
}
func
(
self
*
VMEnv
)
Call
(
me
vm
.
ClosureRef
,
addr
,
data
[]
byte
,
gas
,
price
,
value
*
big
.
Int
)
([]
byte
,
error
)
{
...
...
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