[accelerator] check for high sigops

This commit is contained in:
Mononaut 2024-07-01 07:39:28 +00:00
parent e35ac6e1a2
commit 5067c88642
No known key found for this signature in database
GPG Key ID: A3F058E41374C04E
2 changed files with 4 additions and 2 deletions

View File

@ -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;
}

View File

@ -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;
}