From 10bfc37a656e9862051a6a58ea2acdc561092f6b Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Tue, 11 Aug 2020 11:48:49 -0700 Subject: check password api --- lib/buildtx.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib') diff --git a/lib/buildtx.js b/lib/buildtx.js index 351f8081..0da8c456 100644 --- a/lib/buildtx.js +++ b/lib/buildtx.js @@ -35,11 +35,12 @@ module.exports = async ({ address, amount, feeRate, user }) => { } ]; + debugger let { inputs, outputs, fee } = coinselect(utxos, targets, feeRate); if (!inputs || !outputs) { - l.info("utxos", amount, feeRate, utxos, inputs, outputs); - throw new Error("Failed to create transaction"); + l.info("utxos", amount, feeRate, utxos.map(u => u.value)); + throw new Error("Couldn't find inputs for transaction, check your balance/fee"); } let psbt = new bitcoin.Psbt({ network }); @@ -71,6 +72,5 @@ module.exports = async ({ address, amount, feeRate, user }) => { feeRate = Math.round(feeRate * 1000); psbt = psbt.toBase64(); - l.info("returning", { tx: psbt, feeRate }); return { tx: psbt, feeRate }; }; -- cgit v1.2.3