@@ -282,10 +282,10 @@ export class LocalValidator implements SlpValidator {
282
282
}
283
283
} catch ( _ ) { }
284
284
}
285
- if ( this . cachedValidations [ txid ] . parents . length !== 1 ) {
285
+ if ( this . cachedValidations [ txid ] . parents . length < 1 ) {
286
286
this . cachedValidations [ txid ] . validity = false ;
287
287
this . cachedValidations [ txid ] . waiting = false ;
288
- this . cachedValidations [ txid ] . invalidReason = "MINT transaction must have 1 valid baton parent." ;
288
+ this . cachedValidations [ txid ] . invalidReason = "MINT transaction must have at least 1 candidate baton parent input ." ;
289
289
return this . cachedValidations [ txid ] . validity ! ;
290
290
}
291
291
}
@@ -342,10 +342,14 @@ export class LocalValidator implements SlpValidator {
342
342
// Set validity validation-cache for parents, and handle MINT condition with no valid input
343
343
// we don't need to check proper token id since we only added parents with same ID in above steps.
344
344
const parentTxids = [ ...new Set ( this . cachedValidations [ txid ] . parents . map ( p => p . txid ) ) ] ;
345
- for ( let i = 0 ; i < parentTxids . length ; i ++ ) {
346
- const valid = await this . isValidSlpTxid ( parentTxids [ i ] ) ;
347
- this . cachedValidations [ txid ] . parents . filter ( p => p . txid === parentTxids [ i ] ) . map ( p => p . valid = valid ) ;
348
- if ( this . cachedValidations [ txid ] . details ! . transactionType === SlpTransactionType . MINT && ! valid ) {
345
+ for ( const id of parentTxids ) {
346
+ const valid = await this . isValidSlpTxid ( id ) ;
347
+ this . cachedValidations [ txid ] . parents . filter ( p => p . txid === id ) . map ( p => p . valid = valid ) ;
348
+ }
349
+
350
+ // Check MINT for exactly 1 valid MINT baton
351
+ if ( this . cachedValidations [ txid ] . details ! . transactionType === SlpTransactionType . MINT ) {
352
+ if ( this . cachedValidations [ txid ] . parents . filter ( p => p . valid && p . inputQty === null ) . length !== 1 ) {
349
353
this . cachedValidations [ txid ] . validity = false ;
350
354
this . cachedValidations [ txid ] . waiting = false ;
351
355
this . cachedValidations [ txid ] . invalidReason = "MINT transaction with invalid baton parent." ;
0 commit comments