File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
yarn-project/slasher/src/stores Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -76,9 +76,11 @@ export class SlasherOffensesStore {
7676 /** Adds a new offense (defaults to pending, but will be slashed if markAsSlashed had been called for it) */
7777 public async addPendingOffense ( offense : Offense ) : Promise < void > {
7878 const key = this . getOffenseKey ( offense ) ;
79- await this . offenses . set ( key , serializeOffense ( offense ) ) ;
8079 const round = getRoundForOffense ( offense , this . settings ) ;
81- await this . roundsOffenses . set ( this . getRoundKey ( round ) , key ) ;
80+ await this . kvStore . transactionAsync ( async ( ) => {
81+ await this . offenses . set ( key , serializeOffense ( offense ) ) ;
82+ await this . roundsOffenses . set ( this . getRoundKey ( round ) , key ) ;
83+ } ) ;
8284 this . log . trace ( `Adding pending offense ${ key } for round ${ round } ` ) ;
8385 }
8486
You can’t perform that action at this time.
0 commit comments