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
2fed476c
Unverified
Commit
2fed476c
authored
Jan 09, 2017
by
Bas van Kervel
Committed by
Péter Szilágyi
Jan 09, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
core: fix race condition in WriteMipmapBloom
parent
88cc1ca5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
0 deletions
+6
-0
database_util.go
core/database_util.go
+6
-0
No files found.
core/database_util.go
View file @
2fed476c
...
...
@@ -23,6 +23,7 @@ import (
"errors"
"fmt"
"math/big"
"sync"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/types"
...
...
@@ -63,6 +64,8 @@ var (
oldBlockHashPrefix
=
[]
byte
(
"block-hash-"
)
// [deprecated by the header/block split, remove eventually]
ChainConfigNotFoundErr
=
errors
.
New
(
"ChainConfig not found"
)
// general config not found error
mipmapBloomMu
sync
.
Mutex
// protect against race condition when updating mipmap blooms
)
// encodeBlockNumber encodes a block number as big endian uint64
...
...
@@ -564,6 +567,9 @@ func mipmapKey(num, level uint64) []byte {
// WriteMapmapBloom writes each address included in the receipts' logs to the
// MIP bloom bin.
func
WriteMipmapBloom
(
db
ethdb
.
Database
,
number
uint64
,
receipts
types
.
Receipts
)
error
{
mipmapBloomMu
.
Lock
()
defer
mipmapBloomMu
.
Unlock
()
batch
:=
db
.
NewBatch
()
for
_
,
level
:=
range
MIPMapLevels
{
key
:=
mipmapKey
(
number
,
level
)
...
...
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