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
d18b509e
Commit
d18b509e
authored
May 08, 2017
by
Péter Szilágyi
Committed by
GitHub
May 08, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #14441 from karalabe/receipt-data-regression
core: fix processing regression during receipt import
parents
2e4d23a7
60293820
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
8 deletions
+5
-8
blockchain.go
core/blockchain.go
+4
-3
state_transition.go
core/state_transition.go
+1
-5
No files found.
core/blockchain.go
View file @
d18b509e
...
...
@@ -665,10 +665,11 @@ func SetReceiptsData(config *params.ChainConfig, block *types.Block, receipts ty
// The transaction hash can be retrieved from the transaction itself
receipts
[
j
]
.
TxHash
=
transactions
[
j
]
.
Hash
()
tx
,
_
:=
transactions
[
j
]
.
AsMessage
(
signer
)
// The contract address can be derived from the transaction itself
if
MessageCreatesContract
(
tx
)
{
receipts
[
j
]
.
ContractAddress
=
crypto
.
CreateAddress
(
tx
.
From
(),
tx
.
Nonce
())
if
transactions
[
j
]
.
To
()
==
nil
{
// Deriving the signer is expensive, only do if it's actually needed
from
,
_
:=
types
.
Sender
(
signer
,
transactions
[
j
])
receipts
[
j
]
.
ContractAddress
=
crypto
.
CreateAddress
(
from
,
transactions
[
j
]
.
Nonce
())
}
// The used gas can be calculated based on previous receipts
if
j
==
0
{
...
...
core/state_transition.go
View file @
d18b509e
...
...
@@ -78,10 +78,6 @@ type Message interface {
Data
()
[]
byte
}
func
MessageCreatesContract
(
msg
Message
)
bool
{
return
msg
.
To
()
==
nil
}
// IntrinsicGas computes the 'intrinsic gas' for a message
// with the given data.
//
...
...
@@ -220,7 +216,7 @@ func (self *StateTransition) TransitionDb() (ret []byte, requiredGas, usedGas *b
sender
:=
self
.
from
()
// err checked in preCheck
homestead
:=
self
.
evm
.
ChainConfig
()
.
IsHomestead
(
self
.
evm
.
BlockNumber
)
contractCreation
:=
MessageCreatesContract
(
msg
)
contractCreation
:=
msg
.
To
()
==
nil
// Pay intrinsic gas
// TODO convert to uint64
intrinsicGas
:=
IntrinsicGas
(
self
.
data
,
contractCreation
,
homestead
)
...
...
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