@@ -280,8 +280,7 @@ export class RuneUpdater implements RuneBlockIndex {
280280 for ( const balance of balances . values ( ) ) {
281281 const runeIdString = RuneLocation . toString ( balance . runeId ) ;
282282 const etching =
283- etchingByRuneId . get ( runeIdString ) ??
284- ( await this . _storage . getEtching ( runeIdString , this . block . height - 1 ) ) ;
283+ etchingByRuneId . get ( runeIdString ) ?? ( await this . _storage . getEtching ( runeIdString ) ) ;
285284 if ( etching === null ) {
286285 throw new Error ( 'Rune should exist at this point' ) ;
287286 }
@@ -330,17 +329,31 @@ export class RuneUpdater implements RuneBlockIndex {
330329 if ( optionRune . isSome ( ) ) {
331330 rune = optionRune . unwrap ( ) ;
332331
332+ if ( rune . value < this . _minimum . value ) {
333+ return None ;
334+ }
335+
336+ if ( rune . reserved ) {
337+ return None ;
338+ }
339+
333340 if (
334- rune . value < this . _minimum . value ||
335- rune . reserved ||
336341 this . etchings . find (
337342 ( etching ) => SpacedRune . fromString ( etching . runeName ) . rune . toString ( ) === rune . toString ( )
338- ) ||
339- ( await this . _storage . getRuneLocation ( rune . toString ( ) ) ) !== null ||
340- ! ( await this . txCommitsToRune ( tx , rune ) )
343+ )
341344 ) {
342345 return None ;
343346 }
347+
348+ const runeLocation = await this . _storage . getRuneLocation ( rune . toString ( ) ) ;
349+ if ( runeLocation && runeLocation . block < this . block . height ) {
350+ return None ;
351+ }
352+
353+ const txCommitsToRune = await this . txCommitsToRune ( tx , rune ) ;
354+ if ( ! txCommitsToRune ) {
355+ return None ;
356+ }
344357 } else {
345358 rune = Rune . getReserved ( u64 ( this . block . height ) , u32 ( txIndex ) ) ;
346359 }
@@ -362,8 +375,7 @@ export class RuneUpdater implements RuneBlockIndex {
362375 ) ;
363376
364377 const etching =
365- etchingByRuneId . get ( runeLocation ) ??
366- ( await this . _storage . getEtching ( runeLocation , this . block . height - 1 ) ) ;
378+ etchingByRuneId . get ( runeLocation ) ?? ( await this . _storage . getEtching ( runeLocation ) ) ;
367379 if ( etching === null || ! etching . valid || ! etching . terms ) {
368380 return None ;
369381 }
0 commit comments