aboutsummaryrefslogtreecommitdiffstats
path: root/lib/buildtx.js
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2020-08-11 11:48:49 -0700
committerAdam Soltys <[email protected]>2020-08-11 11:48:49 -0700
commit10bfc37a656e9862051a6a58ea2acdc561092f6b (patch)
tree77018a5bc2b3d0b75802f2e34446e489ad08aa5c /lib/buildtx.js
parent3980fec05509a060ac41f98b4dd126a13e4bc9cd (diff)
downloadcoinos-server-10bfc37a656e9862051a6a58ea2acdc561092f6b.tar.gz
coinos-server-10bfc37a656e9862051a6a58ea2acdc561092f6b.zip
check password api
Diffstat (limited to 'lib/buildtx.js')
-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 };
};