From 1a9f09684415f80a952e7fb1791cc72811e9a701 Mon Sep 17 00:00:00 2001 From: Gal Buki Date: Fri, 1 Jul 2022 22:57:49 +0300 Subject: [PATCH] make async boolean implicit facultative (default: false) --- functions/preimage.js | 2 +- functions/sighash.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/functions/preimage.js b/functions/preimage.js index d5d0304..3887014 100644 --- a/functions/preimage.js +++ b/functions/preimage.js @@ -6,7 +6,7 @@ const decodeHex = require('./decode-hex') const sha256d = require('./sha256d') const sha256Async = require('./sha256-async') -function preimage (tx, vin, parentScript, parentSatoshis, sighashFlags, async) { +function preimage (tx, vin, parentScript, parentSatoshis, sighashFlags, async = false) { const input = tx.inputs[vin] const outputs = tx.outputs || [] diff --git a/functions/sighash.js b/functions/sighash.js index e1d2d6c..6899a7a 100644 --- a/functions/sighash.js +++ b/functions/sighash.js @@ -3,7 +3,7 @@ const preimageAsync = require('./preimage-async') const sha256d = require('./sha256d') const sha256Async = require('./sha256-async') -function sighash (tx, vin, parentScript, parentSatoshis, sighashFlags, async) { +function sighash (tx, vin, parentScript, parentSatoshis, sighashFlags, async = false) { if (async) { return preimageAsync(tx, vin, parentScript, parentSatoshis, sighashFlags) .then(sha256Async)