Skip to content

Commit

Permalink
Execute method acquires state lock
Browse files Browse the repository at this point in the history
  • Loading branch information
Maelkum committed Sep 11, 2023
1 parent 0966222 commit 9047858
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions consensus/pbft/execute.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ import (
// Execute fullfils the consensus interface by inserting the request into the pipeline.
func (r *Replica) Execute(client peer.ID, requestID string, timestamp time.Time, req execute.Request) (codes.Code, execute.Result, error) {

// Modifying state, so acquire state lock now.
r.sl.Lock()
defer r.sl.Unlock()

request := Request{
ID: requestID,
Timestamp: timestamp,
Expand Down

0 comments on commit 9047858

Please sign in to comment.