Merge pull request #1550 from chaotixkilla/fix-cancel-batched-txs

[LAM-891] Allow for batched transactions to be canceled
This commit is contained in:
Rafael Taranto 2023-06-15 20:27:44 +01:00 committed by GitHub
commit f0d992a35c
12 changed files with 21 additions and 18 deletions

View file

@ -223,7 +223,8 @@ function cancel (txId) {
const updateRec = {
error: 'Operator cancel',
error_code: 'operatorCancel',
operator_completed: true
operator_completed: true,
batch_id: null
}
return Promise.resolve()

View file

@ -6,7 +6,8 @@ const wallet = require('./wallet')
function submitBatch (settings, batch) {
txBatching.getBatchTransactions(batch)
.then(txs => {
wallet.sendCoinsBatch(settings, txs, batch.crypto_code)
if (_.isEmpty(txs)) return Promise.resolve()
return wallet.sendCoinsBatch(settings, txs, batch.crypto_code)
.then(res => txBatching.confirmSentBatch(batch, res))
.catch(err => txBatching.setErroredBatch(batch, err.message))
})