feat: reject address reuse
This commit is contained in:
parent
f2080c32e9
commit
f6547341f1
5 changed files with 69 additions and 27 deletions
|
|
@ -124,6 +124,18 @@ function plugins (settings, deviceId) {
|
|||
]
|
||||
}
|
||||
|
||||
function getLcmOrBigx2 (n1, n2) {
|
||||
let big = Math.max(n1, n2);
|
||||
let small = Math.min(n1, n2);
|
||||
|
||||
let i = big * 2;
|
||||
while(i % small !== 0){
|
||||
i += lar;
|
||||
}
|
||||
|
||||
return i;
|
||||
}
|
||||
|
||||
function buildAvailableCassettes (excludeTxId) {
|
||||
const cashOutConfig = configManager.getCashOut(deviceId, settings.config)
|
||||
|
||||
|
|
@ -131,8 +143,7 @@ function plugins (settings, deviceId) {
|
|||
|
||||
const denominations = [cashOutConfig.top, cashOutConfig.bottom]
|
||||
|
||||
// TODO new-admin: will this actually be calculated?
|
||||
const virtualCassettes = [cashOutConfig.top + cashOutConfig.bottom]
|
||||
const virtualCassettes = [getLcmOrBigx2(cashOutConfig.top, cashOutConfig.bottom)]
|
||||
|
||||
return Promise.all([dbm.cassetteCounts(deviceId), cashOutHelper.redeemableTxs(deviceId, excludeTxId)])
|
||||
.then(([rec, _redeemableTxs]) => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue