You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've installed bitcoin node and electrs server on VPS. I write nodejs script to listen new transaction from specific addrs and I get this error when I use Electrum protocol method blockchain.scripthash.subscribe to subscribe scripthash. Then I use electrumClient.subscribe.on event to listen new tx. But I always get this error
Failed to get block: 0000000000000000000000b71ed0d9bec536d4fbbfa4da8dece0edb25324d11db0
This block hash has 66 characters instead of 64 characters. Anyone get this error?
I also delete electrs_db folder and sync data again but it doesn't help.
const crypto = require('crypto');
const ecc = require('tiny-secp256k1');
const bitcoin = require('bitcoinjs-lib');
bitcoin.initEccLib(ecc);
const script = bitcoin.address.toOutputScript('1GrwDkr33gT6LuumniYjKEGjTLhsL5kmqC');
const hash = crypto.createHash('sha256').update(script).digest();
const reversedHash = Buffer.from(hash.reverse());
cosnt scripthash = reversedHash.toString('hex');
electrumClient.blockchainScripthash_subscribe(scripthash).then((scripthash) => {
console.log(`Subscribed to updates for scripthash: ${scriptHash}`);
});
electrumClient.subscribe.on('blockchain.scripthash.subscribe', async (data) => {
const [scripthash, status] = data;
//receive a notification when the status of the script hash changes.
//do something here....
});
The text was updated successfully, but these errors were encountered:
Hi there,
I've installed bitcoin node and electrs server on VPS. I write nodejs script to listen new transaction from specific addrs and I get this error when I use Electrum protocol method blockchain.scripthash.subscribe to subscribe scripthash. Then I use electrumClient.subscribe.on event to listen new tx. But I always get this error
Failed to get block: 0000000000000000000000b71ed0d9bec536d4fbbfa4da8dece0edb25324d11db0
This block hash has 66 characters instead of 64 characters. Anyone get this error?
I also delete electrs_db folder and sync data again but it doesn't help.
The text was updated successfully, but these errors were encountered: