From b92414245872896fe10063e4bbc8dd2b6bc2bc56 Mon Sep 17 00:00:00 2001 From: Mononaut Date: Fri, 10 Oct 2025 08:19:58 +0000 Subject: [PATCH] fix electrum /scripthash/.../utxo --- backend/src/api/bitcoin/electrum-api.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/backend/src/api/bitcoin/electrum-api.ts b/backend/src/api/bitcoin/electrum-api.ts index 681efb7b0..ce8ad3cbb 100644 --- a/backend/src/api/bitcoin/electrum-api.ts +++ b/backend/src/api/bitcoin/electrum-api.ts @@ -165,7 +165,8 @@ class BitcoindElectrsApi extends BitcoinApi implements AbstractBitcoinApi { if (!addressInfo || !addressInfo.isvalid) { return []; } - return await this.$getScriptHashUtxos(addressInfo.scriptPubKey); + const scripthash = this.encodeScriptHash(addressInfo.scriptPubKey); + return this.$getScriptHashUtxos(scripthash); } async $getScriptHashTransactions(scripthash: string, lastSeenTxId?: string): Promise { @@ -240,7 +241,7 @@ class BitcoindElectrsApi extends BitcoinApi implements AbstractBitcoinApi { } private $getScriptHashUnspent(scriptHash: string): Promise { - return this.electrumClient.blockchainScripthash_listunspent(this.encodeScriptHash(scriptHash)); + return this.electrumClient.blockchainScripthash_listunspent(scriptHash); } async $getTransactionMerkleProof(txId: string): Promise {