From 5067c88642d000cd9266188e4a622359c06672b7 Mon Sep 17 00:00:00 2001 From: Mononaut Date: Mon, 1 Jul 2024 07:39:28 +0000 Subject: [PATCH] [accelerator] check for high sigops --- frontend/src/app/components/tracker/tracker.component.ts | 3 ++- .../src/app/components/transaction/transaction.component.ts | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/frontend/src/app/components/tracker/tracker.component.ts b/frontend/src/app/components/tracker/tracker.component.ts index ed386b927..64991b8ed 100644 --- a/frontend/src/app/components/tracker/tracker.component.ts +++ b/frontend/src/app/components/tracker/tracker.component.ts @@ -743,7 +743,8 @@ export class TrackerComponent implements OnInit, OnDestroy { if (this.tx) { this.tx.flags = getTransactionFlags(this.tx); const replaceableInputs = (this.tx.flags & (TransactionFlags.sighash_none | TransactionFlags.sighash_acp)) > 0n; - this.eligibleForAcceleration = !replaceableInputs; + const highSigop = (this.tx.sigops * 20) > this.tx.weight; + this.eligibleForAcceleration = !replaceableInputs && !highSigop; } else { this.eligibleForAcceleration = false; } diff --git a/frontend/src/app/components/transaction/transaction.component.ts b/frontend/src/app/components/transaction/transaction.component.ts index d8aafc319..93c91ef4b 100644 --- a/frontend/src/app/components/transaction/transaction.component.ts +++ b/frontend/src/app/components/transaction/transaction.component.ts @@ -832,7 +832,8 @@ export class TransactionComponent implements OnInit, AfterViewInit, OnDestroy { checkAccelerationEligibility() { if (this.tx && this.tx.flags) { const replaceableInputs = (this.tx.flags & (TransactionFlags.sighash_none | TransactionFlags.sighash_acp)) > 0n; - this.eligibleForAcceleration = !replaceableInputs; + const highSigop = (this.tx.sigops * 20) > this.tx.weight; + this.eligibleForAcceleration = !replaceableInputs && !highSigop; } else { this.eligibleForAcceleration = false; }