backport some missed changes in cash-in and cash-out

This commit is contained in:
Josh Harvey 2018-02-02 00:42:54 +02:00
parent 3cb5ddb24d
commit e22333b7af
3 changed files with 15 additions and 3 deletions

View file

@ -4,6 +4,7 @@ const pgp = require('pg-promise')()
const BN = require('../bn')
const T = require('../time')
const logger = require('../logger')
const E = require('../error')
const PENDING_INTERVAL_MS = 60 * T.minutes
@ -85,7 +86,7 @@ function diff (oldTx, newTx) {
logger.warn('Value from lamassu-machine would violate ratchet [%s]', fieldKey)
logger.warn('Old tx: %j', oldTx)
logger.warn('New tx: %j', newTx)
throw new Error('Value from lamassu-machine would violate ratchet')
throw new E.RatchetError('Value from lamassu-machine would violate ratchet')
}
updatedTx[fieldKey] = newField