aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2020-04-11 21:29:17 -0700
committerAdam Soltys <[email protected]>2020-04-11 21:29:24 -0700
commit3eee6730c118a2dade9fe2290ccc755c3bb399cf (patch)
tree5aac3aaa42341d3cc530243f211bc43ae03d31e7
parent6837b7d9d480517775dc5901a99baed01c730e80 (diff)
downloadcoinos-server-3eee6730c118a2dade9fe2290ccc755c3bb399cf.tar.gz
coinos-server-3eee6730c118a2dade9fe2290ccc755c3bb399cf.zip
blind liquid tx during fee estimation
-rw-r--r--routes/bitcoin/fee.js2
-rw-r--r--routes/liquid/fee.js5
2 files changed, 4 insertions, 3 deletions
diff --git a/routes/bitcoin/fee.js b/routes/bitcoin/fee.js
index 7a0053c4..ba24c4bf 100644
--- a/routes/bitcoin/fee.js
+++ b/routes/bitcoin/fee.js
@@ -23,7 +23,7 @@ module.exports = async (req, res) => {
let signed = (await bc.signRawTransactionWithWallet(tx.hex));
decoded = await bc.decodeRawTransaction(signed.hex);
- feeRate = parseInt(tx.fee * SATS * 1000 / decoded.vsize);
+ feeRate = Math.round(tx.fee * SATS * 1000 / decoded.vsize);
res.send({ feeRate, tx });
} catch (e) {
diff --git a/routes/liquid/fee.js b/routes/liquid/fee.js
index 9dbb7e0a..6dcd57bd 100644
--- a/routes/liquid/fee.js
+++ b/routes/liquid/fee.js
@@ -21,9 +21,10 @@ module.exports = async (req, res) => {
if (config.liquid.walletpass)
await lq.walletPassphrase(config.liquid.walletpass, 300);
- let signed = (await lq.signRawTransactionWithWallet(tx.hex));
+ let blinded = await lq.blindRawTransaction(tx.hex);
+ let signed = (await lq.signRawTransactionWithWallet(blinded));
decoded = await lq.decodeRawTransaction(signed.hex);
- feeRate = parseInt(tx.fee * SATS * 1000 / decoded.vsize);
+ feeRate = Math.round(tx.fee * SATS * 1000 / decoded.vsize);
res.send({ feeRate, tx });
} catch (e) {