Fix input/output overflow in transaction list
This commit is contained in:
		
							parent
							
								
									ca7221f8b7
								
							
						
					
					
						commit
						7a8ae7c9a6
					
				@ -81,7 +81,7 @@
 | 
				
			|||||||
                    </ng-container>
 | 
					                    </ng-container>
 | 
				
			||||||
                  </div>
 | 
					                  </div>
 | 
				
			||||||
                </td>
 | 
					                </td>
 | 
				
			||||||
                <td class="text-right nowrap amount" [class]="{large: vin?.prevout?.value > 1000000000 || vin.isInscription}">
 | 
					                <td class="text-right nowrap amount" [class]="{large: tx.largeInput}">
 | 
				
			||||||
                  <button *ngIf="vin.isInscription" (click)="toggleOrdData(tx.txid, 'vin', vindex)" type="button" class="btn btn-sm badge badge-ord primary" style="margin-right: 10px;">Inscription</button>
 | 
					                  <button *ngIf="vin.isInscription" (click)="toggleOrdData(tx.txid, 'vin', vindex)" type="button" class="btn btn-sm badge badge-ord primary" style="margin-right: 10px;">Inscription</button>
 | 
				
			||||||
                  <ng-template [ngIf]="vin.prevout && vin.prevout.asset && vin.prevout.asset !== nativeAssetId" [ngIfElse]="defaultOutput">
 | 
					                  <ng-template [ngIf]="vin.prevout && vin.prevout.asset && vin.prevout.asset !== nativeAssetId" [ngIfElse]="defaultOutput">
 | 
				
			||||||
                    <div *ngIf="assetsMinimal && assetsMinimal[vin.prevout.asset] else assetVinNotFound">
 | 
					                    <div *ngIf="assetsMinimal && assetsMinimal[vin.prevout.asset] else assetVinNotFound">
 | 
				
			||||||
@ -257,7 +257,7 @@
 | 
				
			|||||||
                    </ng-template>
 | 
					                    </ng-template>
 | 
				
			||||||
                  </ng-template>
 | 
					                  </ng-template>
 | 
				
			||||||
                </td>
 | 
					                </td>
 | 
				
			||||||
                <td class="text-right nowrap amount" [class]="{large: vout?.value > 1000000000}">
 | 
					                <td class="text-right nowrap amount" [class]="{large: tx.largeOutput}">
 | 
				
			||||||
                  <ng-template [ngIf]="vout.asset && vout.asset !== nativeAssetId" [ngIfElse]="defaultOutput">
 | 
					                  <ng-template [ngIf]="vout.asset && vout.asset !== nativeAssetId" [ngIfElse]="defaultOutput">
 | 
				
			||||||
                    <div *ngIf="assetsMinimal && assetsMinimal[vout.asset] else assetNotFound">
 | 
					                    <div *ngIf="assetsMinimal && assetsMinimal[vout.asset] else assetNotFound">
 | 
				
			||||||
                      <ng-container *ngTemplateOutlet="assetBox; context:{ $implicit: vout }"></ng-container>
 | 
					                      <ng-container *ngTemplateOutlet="assetBox; context:{ $implicit: vout }"></ng-container>
 | 
				
			||||||
 | 
				
			|||||||
@ -252,6 +252,7 @@ export class TransactionsListComponent implements OnInit, OnChanges {
 | 
				
			|||||||
              const hasAnnex = tx.vin[i].witness?.[tx.vin[i].witness.length - 1].startsWith('50');
 | 
					              const hasAnnex = tx.vin[i].witness?.[tx.vin[i].witness.length - 1].startsWith('50');
 | 
				
			||||||
              if (tx.vin[i].witness.length > (hasAnnex ? 2 : 1) && tx.vin[i].witness[tx.vin[i].witness.length - (hasAnnex ? 3 : 2)].includes('0063036f7264')) {
 | 
					              if (tx.vin[i].witness.length > (hasAnnex ? 2 : 1) && tx.vin[i].witness[tx.vin[i].witness.length - (hasAnnex ? 3 : 2)].includes('0063036f7264')) {
 | 
				
			||||||
                tx.vin[i].isInscription = true;
 | 
					                tx.vin[i].isInscription = true;
 | 
				
			||||||
 | 
					                tx.largeInput = true;
 | 
				
			||||||
              }
 | 
					              }
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
          }
 | 
					          }
 | 
				
			||||||
@ -262,6 +263,9 @@ export class TransactionsListComponent implements OnInit, OnChanges {
 | 
				
			|||||||
            }
 | 
					            }
 | 
				
			||||||
          }
 | 
					          }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        tx.largeInput = tx.largeInput || tx.vin.some(vin => (vin?.prevout?.value > 1000000000));
 | 
				
			||||||
 | 
					        tx.largeOutput = tx.vout.some(vout => (vout?.value > 1000000000));
 | 
				
			||||||
      });
 | 
					      });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      if (this.blockTime && this.transactions?.length && this.currency) {
 | 
					      if (this.blockTime && this.transactions?.length && this.currency) {
 | 
				
			||||||
 | 
				
			|||||||
@ -32,6 +32,8 @@ export interface Transaction {
 | 
				
			|||||||
  price?: Price;
 | 
					  price?: Price;
 | 
				
			||||||
  sigops?: number;
 | 
					  sigops?: number;
 | 
				
			||||||
  flags?: bigint;
 | 
					  flags?: bigint;
 | 
				
			||||||
 | 
					  largeInput?: boolean;
 | 
				
			||||||
 | 
					  largeOutput?: boolean;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export interface TransactionChannels {
 | 
					export interface TransactionChannels {
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user