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
f8f84ef0
Commit
f8f84ef0
authored
May 21, 2014
by
obscuren
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removed old contract creation code
parent
e1b7bd51
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
26 deletions
+11
-26
block.go
ethchain/block.go
+11
-26
No files found.
ethchain/block.go
View file @
f8f84ef0
...
...
@@ -56,8 +56,6 @@ type Block struct {
// List of transactions and/or contracts
transactions
[]
*
Transaction
TxSha
[]
byte
contractStates
map
[
string
]
*
ethutil
.
Trie
}
// New block takes a raw encoded string
...
...
@@ -91,28 +89,23 @@ func CreateBlock(root interface{},
block
:=
&
Block
{
// Slice of transactions to include in this block
transactions
:
txes
,
PrevHash
:
prevHash
,
Coinbase
:
base
,
Difficulty
:
Difficulty
,
Nonce
:
Nonce
,
Time
:
time
.
Now
()
.
Unix
(),
Extra
:
extra
,
UncleSha
:
EmptyShaList
,
GasUsed
:
new
(
big
.
Int
),
MinGasPrice
:
new
(
big
.
Int
),
GasLimit
:
new
(
big
.
Int
),
contractStates
:
make
(
map
[
string
]
*
ethutil
.
Trie
),
transactions
:
txes
,
PrevHash
:
prevHash
,
Coinbase
:
base
,
Difficulty
:
Difficulty
,
Nonce
:
Nonce
,
Time
:
time
.
Now
()
.
Unix
(),
Extra
:
extra
,
UncleSha
:
EmptyShaList
,
GasUsed
:
new
(
big
.
Int
),
MinGasPrice
:
new
(
big
.
Int
),
GasLimit
:
new
(
big
.
Int
),
}
block
.
SetTransactions
(
txes
)
block
.
SetUncles
([]
*
Block
{})
block
.
state
=
NewState
(
ethutil
.
NewTrie
(
ethutil
.
Config
.
Db
,
root
))
for
_
,
tx
:=
range
txes
{
block
.
MakeContract
(
tx
)
}
return
block
}
...
...
@@ -178,13 +171,6 @@ func (block *Block) Undo() {
block
.
state
.
Reset
()
}
func
(
block
*
Block
)
MakeContract
(
tx
*
Transaction
)
{
contract
:=
MakeContract
(
tx
,
block
.
state
)
if
contract
!=
nil
{
block
.
state
.
states
[
string
(
tx
.
Hash
()[
12
:
])]
=
contract
.
state
}
}
/////// Block Encoding
func
(
block
*
Block
)
rlpTxs
()
interface
{}
{
// Marshal the transactions of this block
...
...
@@ -265,7 +251,6 @@ func (block *Block) RlpValueDecode(decoder *ethutil.Value) {
block
.
Time
=
int64
(
header
.
Get
(
10
)
.
BigInt
()
.
Uint64
())
block
.
Extra
=
header
.
Get
(
11
)
.
Str
()
block
.
Nonce
=
header
.
Get
(
12
)
.
Bytes
()
block
.
contractStates
=
make
(
map
[
string
]
*
ethutil
.
Trie
)
// Tx list might be empty if this is an uncle. Uncles only have their
// header set.
...
...
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