From a112275c518ccafe714562c79a28a0cae7ce4500 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Tue, 10 Sep 2019 21:13:04 -0700 Subject: check for passphrase --- index.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/index.js b/index.js index b21957ed..fe216875 100644 --- a/index.js +++ b/index.js @@ -543,13 +543,14 @@ const authy = new Client({ key: config.authy.key }); } try { - await bc.walletPassphrase(config.bitcoin.walletpass, 300); - l("sending transaction"); + if (config.bitcoin.walletpass) + await bc.walletPassphrase(config.bitcoin.walletpass, 300); + let txid = await bc.sendToAddress( address, (amount / 100000000).toFixed(8) ); - l("transaction sent", txid); + let txhex = await bc.getRawTransaction(txid); let tx = bitcoin.Transaction.fromHex(txhex); -- cgit v1.2.3