Merge branch 'release-8.1' into commission-limits2
This commit is contained in:
commit
eb3eb77bd4
6 changed files with 21 additions and 20 deletions
|
|
@ -29,12 +29,12 @@ const BINARIES = {
|
||||||
dir: 'bitcoin-23.1/bin'
|
dir: 'bitcoin-23.1/bin'
|
||||||
},
|
},
|
||||||
ETH: {
|
ETH: {
|
||||||
url: 'https://gethstore.blob.core.windows.net/builds/geth-linux-amd64-1.11.5-a38f4108.tar.gz',
|
url: 'https://gethstore.blob.core.windows.net/builds/geth-linux-amd64-1.11.6-ea9e62ca.tar.gz',
|
||||||
dir: 'geth-linux-amd64-1.11.5-a38f4108'
|
dir: 'geth-linux-amd64-1.11.6-ea9e62ca'
|
||||||
},
|
},
|
||||||
ZEC: {
|
ZEC: {
|
||||||
url: 'https://z.cash/downloads/zcash-5.4.2-linux64-debian-bullseye.tar.gz',
|
url: 'https://z.cash/downloads/zcash-5.5.0-linux64-debian-bullseye.tar.gz',
|
||||||
dir: 'zcash-5.4.2/bin'
|
dir: 'zcash-5.5.0/bin'
|
||||||
},
|
},
|
||||||
DASH: {
|
DASH: {
|
||||||
url: 'https://github.com/dashpay/dash/releases/download/v18.1.0/dashcore-18.1.0-x86_64-linux-gnu.tar.gz',
|
url: 'https://github.com/dashpay/dash/releases/download/v18.1.0/dashcore-18.1.0-x86_64-linux-gnu.tar.gz',
|
||||||
|
|
@ -52,8 +52,8 @@ const BINARIES = {
|
||||||
files: [['bitcoind', 'bitcoincashd'], ['bitcoin-cli', 'bitcoincash-cli']]
|
files: [['bitcoind', 'bitcoincashd'], ['bitcoin-cli', 'bitcoincash-cli']]
|
||||||
},
|
},
|
||||||
XMR: {
|
XMR: {
|
||||||
url: 'https://downloads.getmonero.org/cli/monero-linux-x64-v0.18.2.0.tar.bz2',
|
url: 'https://downloads.getmonero.org/cli/monero-linux-x64-v0.18.2.2.tar.bz2',
|
||||||
dir: 'monero-x86_64-linux-gnu-v0.18.2.0',
|
dir: 'monero-x86_64-linux-gnu-v0.18.2.2',
|
||||||
files: [['monerod', 'monerod'], ['monero-wallet-rpc', 'monero-wallet-rpc']]
|
files: [['monerod', 'monerod'], ['monero-wallet-rpc', 'monero-wallet-rpc']]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,7 @@ case
|
||||||
else 'Pending'
|
else 'Pending'
|
||||||
end`
|
end`
|
||||||
|
|
||||||
module.exports = {post, monitorPending, cancel, PENDING_INTERVAL, TRANSACTION_STATES}
|
module.exports = { post, monitorPending, cancel, PENDING_INTERVAL, TRANSACTION_STATES }
|
||||||
|
|
||||||
function post (machineTx, pi) {
|
function post (machineTx, pi) {
|
||||||
logger.silly('Updating cashin tx:', machineTx)
|
logger.silly('Updating cashin tx:', machineTx)
|
||||||
|
|
@ -51,12 +51,12 @@ function post (machineTx, pi) {
|
||||||
}
|
}
|
||||||
return postProcess(r, pi, blacklisted, addressReuse, walletScore)
|
return postProcess(r, pi, blacklisted, addressReuse, walletScore)
|
||||||
})
|
})
|
||||||
|
.then(changes => _.set('walletScore', _.isNil(walletScore) ? null : walletScore.score, changes))
|
||||||
.then(changes => cashInLow.update(db, updatedTx, changes))
|
.then(changes => cashInLow.update(db, updatedTx, changes))
|
||||||
.then(tx => _.set('bills', machineTx.bills, tx))
|
.then(tx => _.set('bills', machineTx.bills, tx))
|
||||||
.then(tx => _.set('blacklisted', blacklisted, tx))
|
.then(tx => _.set('blacklisted', blacklisted, tx))
|
||||||
.then(tx => _.set('addressReuse', addressReuse, tx))
|
.then(tx => _.set('addressReuse', addressReuse, tx))
|
||||||
.then(tx => _.set('validWalletScore', _.isNil(walletScore) ? true : walletScore.isValid, tx))
|
.then(tx => _.set('validWalletScore', _.isNil(walletScore) ? true : walletScore.isValid, tx))
|
||||||
.then(tx => _.set('walletScore', _.isNil(walletScore) ? null : walletScore.score, tx))
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -180,9 +180,9 @@ function doesTxReuseAddress (tx) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function getWalletScore (tx, pi) {
|
function getWalletScore (tx, pi) {
|
||||||
pi.isWalletScoringEnabled(tx)
|
return pi.isWalletScoringEnabled(tx)
|
||||||
.then(isEnabled => {
|
.then(isEnabled => {
|
||||||
if(!isEnabled) return null
|
if (!isEnabled) return null
|
||||||
if (!tx.fiat || tx.fiat.isZero()) {
|
if (!tx.fiat || tx.fiat.isZero()) {
|
||||||
return pi.rateWallet(tx.cryptoCode, tx.toAddress)
|
return pi.rateWallet(tx.cryptoCode, tx.toAddress)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -115,22 +115,23 @@ function processTxStatus (tx, settings) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function getWalletScore (tx, pi) {
|
function getWalletScore (tx, pi) {
|
||||||
const rejectEmpty = message => x => _.isNil(x) || _.isEmpty(x) ? Promise.reject({ message }) : x
|
const rejectEmpty = message => x => _.isNil(x) || _.isEmpty(x) ? Promise.reject(new Error(message)) : x
|
||||||
const statuses = ['published', 'authorized', 'confirmed']
|
const statuses = ['published', 'authorized', 'confirmed', 'insufficientFunds']
|
||||||
|
|
||||||
if (_.includes(tx.status, statuses) && _.isNil(tx.walletScore))
|
if (!_.includes(tx.status, statuses) || !_.isNil(tx.walletScore)) {
|
||||||
return tx
|
return tx
|
||||||
|
}
|
||||||
|
|
||||||
// Transaction shows up on the blockchain, we can request the sender address
|
// Transaction shows up on the blockchain, we can request the sender address
|
||||||
return pi.isWalletScoringEnabled(tx)
|
return pi.isWalletScoringEnabled(tx)
|
||||||
.then(isEnabled => {
|
.then(isEnabled => {
|
||||||
if (!isEnabled) return tx
|
if (!isEnabled) return tx
|
||||||
return pi.getTransactionHash(tx)
|
return pi.getTransactionHash(tx)
|
||||||
.then(rejectEmpty("No transaction hashes"))
|
.then(rejectEmpty('No transaction hashes'))
|
||||||
.then(txHashes => pi.getInputAddresses(tx, txHashes))
|
.then(txHashes => pi.getInputAddresses(tx, txHashes))
|
||||||
.then(rejectEmpty("No input addresses"))
|
.then(rejectEmpty('No input addresses'))
|
||||||
.then(addresses => Promise.all(_.map(it => pi.rateWallet(tx.cryptoCode, it), addresses)))
|
.then(addresses => Promise.all(_.map(it => pi.rateWallet(tx.cryptoCode, it), addresses)))
|
||||||
.then(rejectEmpty("No score ratings"))
|
.then(rejectEmpty('No score ratings'))
|
||||||
.then(_.maxBy(_.get(['score'])))
|
.then(_.maxBy(_.get(['score'])))
|
||||||
.then(highestScore =>
|
.then(highestScore =>
|
||||||
// Conservatively assign the highest risk of all input addresses to the risk of this transaction
|
// Conservatively assign the highest risk of all input addresses to the risk of this transaction
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ const CODES_DISPLAY = {
|
||||||
CASHBOX_REMOVED: 'Cashbox removed'
|
CASHBOX_REMOVED: 'Cashbox removed'
|
||||||
}
|
}
|
||||||
|
|
||||||
const NETWORK_DOWN_TIME = 1 * T.minute
|
const NETWORK_DOWN_TIME = 3 * T.minute
|
||||||
const STALE_STATE = 7 * T.minute
|
const STALE_STATE = 7 * T.minute
|
||||||
const ALERT_SEND_INTERVAL = T.hour
|
const ALERT_SEND_INTERVAL = T.hour
|
||||||
|
|
||||||
|
|
|
||||||
2
package-lock.json
generated
2
package-lock.json
generated
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "lamassu-server",
|
"name": "lamassu-server",
|
||||||
"version": "8.1.0-beta.3",
|
"version": "8.1.0",
|
||||||
"lockfileVersion": 1,
|
"lockfileVersion": 1,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
"name": "lamassu-server",
|
"name": "lamassu-server",
|
||||||
"description": "bitcoin atm client server protocol module",
|
"description": "bitcoin atm client server protocol module",
|
||||||
"keywords": [],
|
"keywords": [],
|
||||||
"version": "8.1.0-beta.3",
|
"version": "8.1.0",
|
||||||
"license": "Unlicense",
|
"license": "Unlicense",
|
||||||
"author": "Lamassu (https://lamassu.is)",
|
"author": "Lamassu (https://lamassu.is)",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue