- Bug fix: btcOperator getTx not throwing valid error when invalid txid
- Fixed: toStandardDecimal not rounding upto 8 decimal places on rare cases
This commit is contained in:
sairajzero 2022-11-17 17:41:30 +05:30
parent b0ec2d6a85
commit 28e4815636
3 changed files with 4 additions and 4 deletions

View File

@ -1,4 +1,4 @@
(function (EXPORTS) { //btcOperator v1.0.13
(function (EXPORTS) { //btcOperator v1.0.13a
/* BTC Crypto and API Operator */
const btcOperator = EXPORTS;
@ -713,7 +713,7 @@
}
btcOperator.getTx = txid => new Promise((resolve, reject) => {
fetch_api(`tx/BTC/${txid}`)
fetch_api(`get_tx/BTC/${txid}`)
.then(result => resolve(result.data))
.catch(error => reject(error))
});

View File

@ -203,7 +203,7 @@ verifyTx.BTC = function (sender, txid, group) {
return reject([true, "Transaction not sent by the sender"]);
if (vin_sender.length !== tx.inputs.length)
return reject([true, "Transaction input containes other floIDs"]);
if (!tx.block_no)
if (!tx.blockhash)
return reject([false, "Transaction not included in any block yet"]);
if (!tx.confirmations)
return reject([false, "Transaction not confirmed yet"]);

View File

@ -13,7 +13,7 @@ try {
global[p] = param[p];
}
global.toStandardDecimal = num => (parseInt(num * 1e8) * 1e-8)
global.toStandardDecimal = num => parseFloat((parseInt(num * 1e8) * 1e-8).toFixed(8))
if (!process.argv.includes("--debug"))
global.console.debug = () => null;