Skip to content

Commit c6755c0

Browse files
OttoAllmendingerllm-git
andcommitted
feat(abstract-utxo): remove unused threshold parameter
Remove unused signatureThreshold from generateAddress function as it is not needed and only generates a potential warning. Issue: BTC-2652 Co-authored-by: llm-git <[email protected]>
1 parent 394f6ee commit c6755c0

File tree

1 file changed

+1
-12
lines changed

1 file changed

+1
-12
lines changed

modules/abstract-utxo/src/address/fixedScript.ts

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ export function generateAddress(network: utxolib.Network, params: GenerateFixedS
8787
derivationIndex = params.index as number;
8888
}
8989

90-
const { keychains, threshold, chain, segwit = false, bech32 = false } = params as GenerateFixedScriptAddressOptions;
90+
const { keychains, chain, segwit = false, bech32 = false } = params as GenerateFixedScriptAddressOptions;
9191

9292
let derivationChain = bitgo.getExternalChainCode('p2sh');
9393
if (_.isNumber(chain) && _.isInteger(chain) && bitgo.isChainCode(chain)) {
@@ -130,17 +130,6 @@ export function generateAddress(network: utxolib.Network, params: GenerateFixedS
130130
}
131131
}
132132

133-
let signatureThreshold = 2;
134-
if (_.isInteger(threshold)) {
135-
signatureThreshold = threshold as number;
136-
if (signatureThreshold <= 0) {
137-
throw new Error('threshold has to be positive');
138-
}
139-
if (signatureThreshold > keychains.length) {
140-
throw new Error('threshold cannot exceed number of keys');
141-
}
142-
}
143-
144133
return generateAddressWithChainAndIndex(network, keychains, derivationChain, derivationIndex, params.format);
145134
}
146135

0 commit comments

Comments
 (0)