aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/buildtx.js6
1 files changed, 3 insertions, 3 deletions
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 };
};