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
b4369e10
Commit
b4369e10
authored
Aug 18, 2015
by
Jeffrey Wilcke
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
core, miner: write miner receipts
parent
2497f28a
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
14 additions
and
9 deletions
+14
-9
block_processor.go
core/block_processor.go
+3
-5
chain_manager.go
core/chain_manager.go
+3
-1
filter.go
core/filter.go
+3
-1
worker.go
miner/worker.go
+5
-2
No files found.
core/block_processor.go
View file @
b4369e10
...
...
@@ -349,11 +349,9 @@ func (sm *BlockProcessor) GetBlockReceipts(bhash common.Hash) types.Receipts {
// the depricated way by re-processing the block.
func
(
sm
*
BlockProcessor
)
GetLogs
(
block
*
types
.
Block
)
(
logs
state
.
Logs
,
err
error
)
{
receipts
:=
GetBlockReceipts
(
sm
.
chainDb
,
block
.
Hash
())
if
len
(
receipts
)
>
0
{
// coalesce logs
for
_
,
receipt
:=
range
receipts
{
logs
=
append
(
logs
,
receipt
.
Logs
()
...
)
}
// coalesce logs
for
_
,
receipt
:=
range
receipts
{
logs
=
append
(
logs
,
receipt
.
Logs
()
...
)
}
return
logs
,
nil
}
...
...
core/chain_manager.go
View file @
b4369e10
...
...
@@ -647,7 +647,9 @@ func (self *ChainManager) InsertChain(chain types.Blocks) (int, error) {
queue
[
i
]
=
ChainSplitEvent
{
block
,
logs
}
queueEvent
.
splitCount
++
}
PutBlockReceipts
(
self
.
chainDb
,
block
,
receipts
)
if
err
:=
PutBlockReceipts
(
self
.
chainDb
,
block
,
receipts
);
err
!=
nil
{
glog
.
V
(
logger
.
Warn
)
.
Infoln
(
"error writing block receipts:"
,
err
)
}
stats
.
processed
++
}
...
...
core/filter.go
View file @
b4369e10
...
...
@@ -22,6 +22,8 @@ import (
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/state"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/logger"
"github.com/ethereum/go-ethereum/logger/glog"
)
type
AccountChange
struct
{
...
...
@@ -111,7 +113,7 @@ done:
// Get the logs of the block
unfiltered
,
err
:=
self
.
eth
.
BlockProcessor
()
.
GetLogs
(
block
)
if
err
!=
nil
{
chainlogger
.
Warn
ln
(
"err: filter get logs "
,
err
)
glog
.
V
(
logger
.
Warn
)
.
Info
ln
(
"err: filter get logs "
,
err
)
break
}
...
...
miner/worker.go
View file @
b4369e10
...
...
@@ -297,14 +297,17 @@ func (self *worker) wait() {
}
// broadcast before waiting for validation
go
func
(
block
*
types
.
Block
,
logs
state
.
Logs
)
{
go
func
(
block
*
types
.
Block
,
logs
state
.
Logs
,
receipts
[]
*
types
.
Receipt
)
{
self
.
mux
.
Post
(
core
.
NewMinedBlockEvent
{
block
})
self
.
mux
.
Post
(
core
.
ChainEvent
{
block
,
block
.
Hash
(),
logs
})
if
stat
==
core
.
CanonStatTy
{
self
.
mux
.
Post
(
core
.
ChainHeadEvent
{
block
})
self
.
mux
.
Post
(
logs
)
}
}(
block
,
work
.
state
.
Logs
())
if
err
:=
core
.
PutBlockReceipts
(
self
.
chainDb
,
block
,
receipts
);
err
!=
nil
{
glog
.
V
(
logger
.
Warn
)
.
Infoln
(
"error writing block receipts:"
,
err
)
}
}(
block
,
work
.
state
.
Logs
(),
work
.
receipts
)
}
// check staleness and display confirmation
...
...
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