From 2acd39fac256bed21e57a01e542e8473d596cec3 Mon Sep 17 00:00:00 2001 From: Rafael Taranto Date: Tue, 11 Mar 2025 10:49:39 +0000 Subject: [PATCH 1/3] fix: update math for eth sends --- lib/plugins/wallet/geth/base.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/plugins/wallet/geth/base.js b/lib/plugins/wallet/geth/base.js index 8b9fa9dc..cb6a6fcb 100644 --- a/lib/plugins/wallet/geth/base.js +++ b/lib/plugins/wallet/geth/base.js @@ -161,7 +161,7 @@ function generateErc20Tx (_toAddress, wallet, amount, includesFee, cryptoCode) { .then(([gas, txCount, baseFeePerGas]) => { lastUsedNonces[fromAddress] = txCount - const maxPriorityFeePerGas = new BN(web3.utils.toWei('2.5', 'gwei')) // web3 default value + const maxPriorityFeePerGas = new BN(web3.utils.toWei('1.0', 'gwei')) // web3 default value const maxFeePerGas = new BN(2).times(baseFeePerGas).plus(maxPriorityFeePerGas) if (includesFee && (toSend.isNegative() || toSend.isZero())) { @@ -219,9 +219,8 @@ function generateTx (_toAddress, wallet, amount, includesFee, cryptoCode, txId) .then(([gas, gasPrice, txCount, baseFeePerGas]) => { lastUsedNonces[fromAddress] = txCount - const maxPriorityFeePerGas = new BN(web3.utils.toWei('2.5', 'gwei')) // web3 default value - const neededPriority = new BN(web3.utils.toWei('2.0', 'gwei')) - const maxFeePerGas = baseFeePerGas.plus(neededPriority) + const maxPriorityFeePerGas = new BN(web3.utils.toWei('1.0', 'gwei')) // web3 default value + const maxFeePerGas = baseFeePerGas.times(2).plus(maxPriorityFeePerGas) const newGasPrice = BN.minimum(maxFeePerGas, baseFeePerGas.plus(maxPriorityFeePerGas)) const toSend = includesFee From 2ea86ef874572a88b7b6f15483ab3cdfa8ceec9d Mon Sep 17 00:00:00 2001 From: Rafael Taranto Date: Tue, 11 Mar 2025 12:46:48 +0000 Subject: [PATCH 2/3] fix: automatic cashbox batch creation --- lib/cashbox-batches.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/cashbox-batches.js b/lib/cashbox-batches.js index 35a03d9e..9465ae70 100644 --- a/lib/cashbox-batches.js +++ b/lib/cashbox-batches.js @@ -21,7 +21,7 @@ function createCashboxBatch (deviceId, cashboxCount) { return db.tx(t => { const batchId = uuid.v4() - const q1 = t.none(sql, [batchId, deviceId]) + const q1 = t.one(sql, [batchId, deviceId]) const q2 = t.none(sql2, [batchId, deviceId]) const q3 = t.none(sql3, [batchId, deviceId]) return t.batch([q1, q2, q3]) From 929a3babee0413805f19054269dd5cbb6a2e2634 Mon Sep 17 00:00:00 2001 From: Rafael Taranto Date: Tue, 11 Mar 2025 12:53:50 +0000 Subject: [PATCH 3/3] chore: add logging to ofac failures --- lib/sanctions.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/sanctions.js b/lib/sanctions.js index 34b1b7fd..33900835 100644 --- a/lib/sanctions.js +++ b/lib/sanctions.js @@ -19,7 +19,7 @@ const loadOrUpdateSanctions = () => { sanctionStatus.timestamp = Date.now() }) .catch(e => { - logger.error('Couldn\'t load OFAC sanction list!') + logger.error('Couldn\'t load OFAC sanction list!', e) }) }