@ipfs-flipstarter/utils
Advanced tools
Comparing version 1.0.1 to 1.0.2
@@ -64,2 +64,6 @@ const EventEmitter = require("events"); | ||
getScriptHash(script) { | ||
return Blockchain.getScriptHash(script); | ||
} | ||
/** | ||
@@ -82,4 +86,9 @@ * | ||
async getTransaction(txHash) { | ||
const tx = await this.getTransactionRaw(txHash); | ||
return Transaction.fromHex(tx); | ||
const txHex = await this.getTransactionRaw(txHash); | ||
const tx = Transaction.fromHex(txHex); | ||
tx.outs.forEach(vout => { | ||
vout.scriptHash = Blockchain.getScriptHash(vout.script) | ||
}); | ||
return tx; | ||
} | ||
@@ -86,0 +95,0 @@ |
@@ -16,3 +16,3 @@ // Load the electrum library. | ||
await Promise.all(servers.map(({ address, port, scheme }) => { | ||
servers.map(async ({ address, port, scheme }) => { | ||
if (!port && scheme) { | ||
@@ -22,6 +22,8 @@ const transport = transports.find(t => t.Scheme === scheme); | ||
} | ||
return electrum.addServer(address, port, scheme).catch(err => { | ||
debugger; | ||
}); | ||
})); | ||
try { | ||
return await electrum.addServer(address, port, scheme); | ||
} catch (err) { | ||
console.log("Electrum startup error: " + scheme + "://" + address + ":" + port, err) | ||
} | ||
}); | ||
@@ -28,0 +30,0 @@ // Wait for enough connections to be available. |
{ | ||
"name": "@ipfs-flipstarter/utils", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
64550
1666