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
4ee92f2d
Unverified
Commit
4ee92f2d
authored
Aug 23, 2017
by
Péter Szilágyi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
core/types: reject Metro receipts with > 0x01 status bytes
parent
79bf69b5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
4 deletions
+11
-4
receipt.go
core/types/receipt.go
+11
-4
No files found.
core/types/receipt.go
View file @
4ee92f2d
...
...
@@ -108,14 +108,21 @@ func (r *Receipt) DecodeRLP(s *rlp.Stream) error {
}
// Deserialize based on the first component type.
switch
{
case
kind
==
rlp
.
Byte
||
kind
==
rlp
.
String
&&
len
(
cnt
)
==
0
:
// The first component of metropolis receipts is Byte
//
or empty String(
byte with 0x00 value).
case
kind
==
rlp
.
Byte
||
(
kind
==
rlp
.
String
&&
len
(
cnt
)
==
0
)
:
// The first component of metropolis receipts is Byte
(0x01), or the empty
//
string (0x80, decoded as a
byte with 0x00 value).
var
metro
metropolisReceiptRLP
if
err
:=
rlp
.
DecodeBytes
(
raw
,
&
metro
);
err
!=
nil
{
return
err
}
r
.
Failed
=
metro
.
Status
==
receiptStatusFailed
switch
metro
.
Status
{
case
receiptStatusSuccessful
:
r
.
Failed
=
false
case
receiptStatusFailed
:
r
.
Failed
=
true
default
:
return
fmt
.
Errorf
(
"invalid status byte: 0x%x"
,
metro
.
Status
)
}
r
.
CumulativeGasUsed
=
metro
.
CumulativeGasUsed
r
.
Bloom
=
metro
.
Bloom
r
.
Logs
=
metro
.
Logs
...
...
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