Skip to content

Commit

Permalink
Make eventsdb deadlock-free
Browse files Browse the repository at this point in the history
  • Loading branch information
danil-lashin committed Oct 22, 2018
1 parent 29ef3c9 commit d5c353f
Show file tree
Hide file tree
Showing 99 changed files with 52 additions and 22,142 deletions.
2 changes: 1 addition & 1 deletion Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ check: check_tools ensure_deps
### Build

build:
CGO_ENABLED=1 go build $(BUILD_FLAGS) -tags '$(BUILD_TAGS)' -o build/minter ./cmd/minter/
CGO_ENABLED=0 go build $(BUILD_FLAGS) -tags '$(BUILD_TAGS)' -o build/minter ./cmd/minter/

install:
CGO_ENABLED=1 go install $(BUILD_FLAGS) -tags '$(BUILD_TAGS)' ./cmd/minter
CGO_ENABLED=0 go install $(BUILD_FLAGS) -tags '$(BUILD_TAGS)' ./cmd/minter


########################################
Expand Down
14 changes: 12 additions & 2 deletions api/validators.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,14 +73,24 @@ func GetValidators(w http.ResponseWriter, r *http.Request) {
}

rState := GetStateForRequest(r)
vals := rState.GetStateValidators().Data()
vals := rState.GetStateValidators()

w.Header().Set("Content-Type", "application/json; charset=UTF-8")

if vals == nil {
w.WriteHeader(http.StatusNotFound)
_ = json.NewEncoder(w).Encode(Response{
Code: 404,
Log: "Validators not found",
})
return
}

w.WriteHeader(http.StatusOK)

var responseValidators []Validator

for _, val := range vals {
for _, val := range vals.Data() {
responseValidators = append(responseValidators, makeResponseValidator(val, rState))
}

Expand Down
2 changes: 1 addition & 1 deletion core/minter/minter.go
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ func (app *Blockchain) EndBlock(req abciTypes.RequestEndBlock) abciTypes.Respons
}
}

eventsdb.GetCurrent().FlushEvents(req.Height)
_ = eventsdb.GetCurrent().FlushEvents(req.Height)

return abciTypes.ResponseEndBlock{
ValidatorUpdates: updates,
Expand Down
24 changes: 0 additions & 24 deletions crypto/secp256k1/.gitignore

This file was deleted.

31 changes: 0 additions & 31 deletions crypto/secp256k1/LICENSE

This file was deleted.

Loading

0 comments on commit d5c353f

Please sign in to comment.