mirror of
https://github.com/mempool/mempool.git
synced 2025-02-22 14:22:44 +01:00
remove unused calcScriptHash function
This commit is contained in:
parent
5b2470955d
commit
63ccecf410
1 changed files with 0 additions and 9 deletions
|
@ -3,7 +3,6 @@ import { IEsploraApi } from './bitcoin/esplora-api.interface';
|
|||
import { Common } from './common';
|
||||
import bitcoinApi, { bitcoinCoreApi } from './bitcoin/bitcoin-api-factory';
|
||||
import * as bitcoinjs from 'bitcoinjs-lib';
|
||||
import crypto from 'node:crypto';
|
||||
|
||||
class TransactionUtils {
|
||||
constructor() { }
|
||||
|
@ -171,14 +170,6 @@ class TransactionUtils {
|
|||
16
|
||||
);
|
||||
}
|
||||
|
||||
public calcScriptHash(script: string): string {
|
||||
if (!/^[0-9a-fA-F]*$/.test(script) || script.length % 2 !== 0) {
|
||||
throw new Error('script is not a valid hex string');
|
||||
}
|
||||
const buf = Buffer.from(script, 'hex');
|
||||
return crypto.createHash('sha256').update(buf).digest('hex');
|
||||
}
|
||||
}
|
||||
|
||||
export default new TransactionUtils();
|
||||
|
|
Loading…
Add table
Reference in a new issue