diff options
| author | Adam Soltys <[email protected]> | 2019-10-15 06:42:51 +0000 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2019-10-15 06:42:57 +0000 |
| commit | babd01948f5e01d326feece425654cb17b6c7d9f (patch) | |
| tree | 51f38c1ea61fb1aed5128a1b532d3b2ee76dfe7b /sendCoins.js | |
| parent | a3ae613d7e2cde43096dcd80f8a1e04a7fb2512f (diff) | |
| download | coinos-server-babd01948f5e01d326feece425654cb17b6c7d9f.tar.gz coinos-server-babd01948f5e01d326feece425654cb17b6c7d9f.zip | |
sign after wallet is unlocked
Diffstat (limited to 'sendCoins.js')
| -rw-r--r-- | sendCoins.js | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/sendCoins.js b/sendCoins.js index 997af0dd..b1456798 100644 --- a/sendCoins.js +++ b/sendCoins.js @@ -18,8 +18,6 @@ module.exports = (app, bc, db, emit) => async (req, res) => { let { hex, fee } = rawtx; fee = parseInt(fee * SATS); - rawtx = (await bc.signRawTransactionWithWallet(hex)).hex; - l("sending coins", req.user.username, amount, address); try { @@ -48,10 +46,10 @@ module.exports = (app, bc, db, emit) => async (req, res) => { if (config.bitcoin.walletpass) await bc.walletPassphrase(config.bitcoin.walletpass, 300); + rawtx = (await bc.signRawTransactionWithWallet(hex)).hex; let txid = await bc.sendRawTransaction(rawtx); - let txhex = await bc.getRawTransaction(txid); - let tx = bitcoin.Transaction.fromHex(txhex); + let tx = bitcoin.Transaction.fromHex(rawtx); let total = Math.min(amount + fee, req.user.balance); if (req.user.balance < 0) req.user.balance = 0; |
