fix: use opid variable

This commit is contained in:
José Oliveira 2021-02-26 14:20:33 +00:00 committed by Josh Harvey
parent e326f4c0e5
commit 5d45cf456c

View file

@ -71,13 +71,13 @@ function sendCoins (account, address, cryptoAtoms, cryptoCode) {
}) })
}) })
} }
const checker = async () => {
return pRetry(checkSendStatus, { retries: 20, minTimeout: 300, factor: 1.05 }) const checker = opid => pRetry(() => checkSendStatus(opid), { retries: 20, minTimeout: 300, factor: 1.05 })
}
return checkCryptoCode(cryptoCode) return checkCryptoCode(cryptoCode)
.then(() => fetch('z_sendmany', ["ANY_TADDR", [{address, amount: coins}]])) .then(() => fetch('z_sendmany', ['ANY_TADDR', [{ address, amount: coins }]]))
.then(checker) .then(checker)
.then((res) => { .then((res) => {
return { return {
fee: _.get('params.fee', res), fee: _.get('params.fee', res),
txid: _.get('result.txid', res) txid: _.get('result.txid', res)