Skip to content

Commit 0c38a66

Browse files
authored
Merge pull request #2171 from JacksonDMiller/JacksonDMiller-addStripWitnessesToTransaction
Update v6 branch: Add stripWitness to Transaction Issue 2169 #2170
2 parents 57078a2 + c463f5f commit 0c38a66

File tree

7 files changed

+22
-224
lines changed

7 files changed

+22
-224
lines changed

.github/workflows/main_ci.yml

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -61,17 +61,6 @@ jobs:
6161
#####################
6262
# Jobs without matrix
6363
#####################
64-
audit:
65-
runs-on: ubuntu-latest
66-
steps:
67-
- uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579 # v2
68-
- uses: actions/setup-node@eeb10cff27034e7acf239c5d29f62154018672fd # v3
69-
with:
70-
node-version: 'lts/*'
71-
registry-url: https://registry.npmjs.org/
72-
cache: 'npm'
73-
- run: npm ci
74-
- run: npm run audit
7564
coverage:
7665
runs-on: ubuntu-latest
7766
steps:

package-lock.json

Lines changed: 0 additions & 211 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
"bitcoinjs"
1616
],
1717
"scripts": {
18-
"audit": "better-npm-audit audit -l high",
1918
"build": "npm run clean && tsc -p ./tsconfig.json && npm run formatjs",
2019
"build:tests": "npm run clean:jstests && tsc -p ./test/tsconfig.json",
2120
"clean": "rimraf src",
@@ -66,7 +65,6 @@
6665
"@types/randombytes": "^2.0.0",
6766
"@typescript-eslint/eslint-plugin": "^5.45.0",
6867
"@typescript-eslint/parser": "^5.45.0",
69-
"better-npm-audit": "^3.7.3",
7068
"bip32": "^4.0.0",
7169
"bip39": "^3.1.0",
7270
"bip65": "^1.0.1",

src/transaction.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ export declare class Transaction {
3535
addInput(hash: Buffer, index: number, sequence?: number, scriptSig?: Buffer): number;
3636
addOutput(scriptPubKey: Buffer, value: number): number;
3737
hasWitnesses(): boolean;
38+
stripWitnesses(): void;
3839
weight(): number;
3940
virtualSize(): number;
4041
byteLength(_ALLOW_WITNESS?: boolean): number;

src/transaction.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,11 @@ class Transaction {
148148
return x.witness.length !== 0;
149149
});
150150
}
151+
stripWitnesses() {
152+
this.ins.forEach(input => {
153+
input.witness = EMPTY_WITNESS; // Set witness data to an empty array
154+
});
155+
}
151156
weight() {
152157
const base = this.byteLength(false);
153158
const total = this.byteLength(true);

0 commit comments

Comments
 (0)