fixed data entry into right backup db for backup supernode as acting supernode
This commit is contained in:
parent
0fe95a7915
commit
a337b28d03
@ -11241,7 +11241,7 @@
|
|||||||
// CHECK HERE IF USER IS INDULGED IN ANY MORE TRADE. IF TRUE RETURN ERROR
|
// CHECK HERE IF USER IS INDULGED IN ANY MORE TRADE. IF TRUE RETURN ERROR
|
||||||
await readAllDB("deposit").then(function (res) {
|
await readAllDB("deposit").then(function (res) {
|
||||||
if (typeof res == "object" && res.length > 0) {
|
if (typeof res == "object" && res.length > 0) {
|
||||||
let canUserTrade = res.map(function (user) {
|
let canUserTrade = res.filter(function (user) {
|
||||||
return (respective_trader_id == user.trader_flo_address
|
return (respective_trader_id == user.trader_flo_address
|
||||||
&& user.status==1);
|
&& user.status==1);
|
||||||
});
|
});
|
||||||
@ -12477,8 +12477,8 @@
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
||||||
if(typeof res_obj.params[0].trader_flo_address !="string") return;
|
if(typeof params.trader_flo_address !="string") return;
|
||||||
const my_closest_su_list = localbitcoinplusplus.kademlia.determineClosestSupernode(params.trader_flo_address);
|
const my_closest_su_list = await localbitcoinplusplus.kademlia.determineClosestSupernode(params.trader_flo_address);
|
||||||
const primarySupernodeOfThisUser = my_closest_su_list[0].data.id;
|
const primarySupernodeOfThisUser = my_closest_su_list[0].data.id;
|
||||||
const backup_server_db_instance = localbitcoinplusplus.newBackupDatabase.db[primarySupernodeOfThisUser];
|
const backup_server_db_instance = localbitcoinplusplus.newBackupDatabase.db[primarySupernodeOfThisUser];
|
||||||
|
|
||||||
@ -12490,8 +12490,9 @@
|
|||||||
// CHECK HERE IF USER IS INDULGED IN ANY MORE TRADE. IF TRUE RETURN ERROR
|
// CHECK HERE IF USER IS INDULGED IN ANY MORE TRADE. IF TRUE RETURN ERROR
|
||||||
await backup_server_db_instance.backup_readAllDB("deposit").then(function (res) {
|
await backup_server_db_instance.backup_readAllDB("deposit").then(function (res) {
|
||||||
if (typeof res == "object" && res.length > 0) {
|
if (typeof res == "object" && res.length > 0) {
|
||||||
let canUserTrade = res.map(function (user) {
|
let canUserTrade = res.filter(function (user) {
|
||||||
return respective_trader_id == user.trader_flo_address;
|
return (respective_trader_id == user.trader_flo_address
|
||||||
|
&& user.status==1);
|
||||||
});
|
});
|
||||||
if (canUserTrade.includes(true)) {
|
if (canUserTrade.includes(true)) {
|
||||||
request.response =
|
request.response =
|
||||||
@ -12554,8 +12555,11 @@
|
|||||||
if (is_valid_request !== true) return false;
|
if (is_valid_request !== true) return false;
|
||||||
await RM_TRADE.resolve_current_crypto_price_in_fiat(params.product,
|
await RM_TRADE.resolve_current_crypto_price_in_fiat(params.product,
|
||||||
params.currency);
|
params.currency);
|
||||||
|
const get_requester_primary_supernode = await localbitcoinplusplus.kademlia
|
||||||
|
.determineClosestSupernode(params.trader_flo_address);
|
||||||
|
const primarySupernodeForThisUser = get_requester_primary_supernode[0].data.id;
|
||||||
let trade_margin = await RM_TRADE.getAssetTradeAndWithdrawLimit(
|
let trade_margin = await RM_TRADE.getAssetTradeAndWithdrawLimit(
|
||||||
params.trader_flo_address, params.product, params.currency, request.globalParams.receiverFloId);
|
params.trader_flo_address, params.product, params.currency, primarySupernodeForThisUser);
|
||||||
if (typeof trade_margin.remaining_crypto_credit == "number" &&
|
if (typeof trade_margin.remaining_crypto_credit == "number" &&
|
||||||
typeof trade_margin.remaining_fiat_credit == "number") {
|
typeof trade_margin.remaining_fiat_credit == "number") {
|
||||||
if (trade_margin.remaining_fiat_credit > 0 && trade_margin.remaining_fiat_credit >=
|
if (trade_margin.remaining_fiat_credit > 0 && trade_margin.remaining_fiat_credit >=
|
||||||
@ -12572,10 +12576,10 @@
|
|||||||
supernode_signed_res);
|
supernode_signed_res);
|
||||||
doSend(buy_request_response);
|
doSend(buy_request_response);
|
||||||
// Init trading
|
// Init trading
|
||||||
RM_TRADE.createTradePipes(params.currency, request.globalParams.receiverFloId);
|
RM_TRADE.createTradePipes(params.currency, primarySupernodeForThisUser);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}, request.globalParams.receiverFloId);
|
}, primarySupernodeForThisUser);
|
||||||
} else {
|
} else {
|
||||||
err_msg = `Trade Margin Check Failed: You can only trade upto ${params.currency} ${trade_margin.remaining_fiat_credit}.`;
|
err_msg = `Trade Margin Check Failed: You can only trade upto ${params.currency} ${trade_margin.remaining_fiat_credit}.`;
|
||||||
showMessage(err_msg);
|
showMessage(err_msg);
|
||||||
@ -12594,8 +12598,11 @@
|
|||||||
if (is_valid_request !== true) return false;
|
if (is_valid_request !== true) return false;
|
||||||
await RM_TRADE.resolve_current_crypto_price_in_fiat(params.product,
|
await RM_TRADE.resolve_current_crypto_price_in_fiat(params.product,
|
||||||
params.currency);
|
params.currency);
|
||||||
|
const get_requester_primary_supernode = await localbitcoinplusplus.kademlia
|
||||||
|
.determineClosestSupernode(params.trader_flo_address);
|
||||||
|
const primarySupernodeForThisUser = get_requester_primary_supernode[0].data.id;
|
||||||
let trade_margin = await RM_TRADE.getAssetTradeAndWithdrawLimit(
|
let trade_margin = await RM_TRADE.getAssetTradeAndWithdrawLimit(
|
||||||
params.trader_flo_address, params.product, params.currency, request.globalParams.receiverFloId);
|
params.trader_flo_address, params.product, params.currency, primarySupernodeForThisUser);
|
||||||
if (typeof trade_margin.remaining_crypto_credit == "number" &&
|
if (typeof trade_margin.remaining_crypto_credit == "number" &&
|
||||||
typeof trade_margin.remaining_fiat_credit == "number") {
|
typeof trade_margin.remaining_fiat_credit == "number") {
|
||||||
let eqCrypto = RM_TRADE.calculateCryptoEquivalentOfCash(params.buy_price);
|
let eqCrypto = RM_TRADE.calculateCryptoEquivalentOfCash(params.buy_price);
|
||||||
@ -12613,10 +12620,10 @@
|
|||||||
supernode_signed_res);
|
supernode_signed_res);
|
||||||
doSend(sell_request_response);
|
doSend(sell_request_response);
|
||||||
// Init trading
|
// Init trading
|
||||||
RM_TRADE.createTradePipes(params.currency, request.globalParams.receiverFloId);
|
RM_TRADE.createTradePipes(params.currency, primarySupernodeForThisUser);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}, request.globalParams.receiverFloId
|
}, primarySupernodeForThisUser
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
err_msg = `WARNING: Trade Margin Check Failed:
|
err_msg = `WARNING: Trade Margin Check Failed:
|
||||||
@ -13048,9 +13055,12 @@
|
|||||||
) {
|
) {
|
||||||
await RM_TRADE.resolve_current_crypto_price_in_fiat(params.product,
|
await RM_TRADE.resolve_current_crypto_price_in_fiat(params.product,
|
||||||
params.currency);
|
params.currency);
|
||||||
|
const get_requester_primary_supernode = await localbitcoinplusplus.kademlia
|
||||||
|
.determineClosestSupernode(params.trader_flo_address);
|
||||||
|
const primarySupernodeForThisUser = get_requester_primary_supernode[0].data.id;
|
||||||
let trade_margin = await RM_TRADE.getAssetTradeAndWithdrawLimit(
|
let trade_margin = await RM_TRADE.getAssetTradeAndWithdrawLimit(
|
||||||
params.trader_flo_address, params.product, params.currency,
|
params.trader_flo_address, params.product, params.currency,
|
||||||
request.globalParams.receiverFloId
|
primarySupernodeForThisUser
|
||||||
);
|
);
|
||||||
|
|
||||||
if (localbitcoinplusplus.master_configurations.tradableAsset1.includes(
|
if (localbitcoinplusplus.master_configurations.tradableAsset1.includes(
|
||||||
@ -13493,9 +13503,9 @@
|
|||||||
// Number(parseFloat(
|
// Number(parseFloat(
|
||||||
// btc_eq_receiving_amount
|
// btc_eq_receiving_amount
|
||||||
// )
|
// )
|
||||||
.toFixed(
|
// .toFixed(
|
||||||
8
|
// 8
|
||||||
));
|
// ));
|
||||||
res_bal
|
res_bal
|
||||||
.crypto_balance -=
|
.crypto_balance -=
|
||||||
EqCryptoWd;
|
EqCryptoWd;
|
||||||
@ -13822,13 +13832,15 @@
|
|||||||
|
|
||||||
if (typeof backup_db=="string" && backup_db.length>0) {
|
if (typeof backup_db=="string" && backup_db.length>0) {
|
||||||
if (typeof localbitcoinplusplus.newBackupDatabase.db[backup_db] == "object") {
|
if (typeof localbitcoinplusplus.newBackupDatabase.db[backup_db] == "object") {
|
||||||
readDB = localbitcoinplusplus.newBackupDatabase.db[backup_db].backup_readDB;
|
const foreign_db = localbitcoinplusplus.newBackupDatabase.db[backup_db];
|
||||||
readDBbyIndex = localbitcoinplusplus.newBackupDatabase.db[backup_db].backup_readDBbyIndex;
|
addDB = foreign_db.backup_addDB.bind(foreign_db);
|
||||||
readAllDB = localbitcoinplusplus.newBackupDatabase.db[backup_db].backup_readAllDB;
|
readDB = foreign_db.backup_readDB.bind(foreign_db);
|
||||||
updateinDB = localbitcoinplusplus.newBackupDatabase.db[backup_db].backup_updateinDB;
|
readDBbyIndex = foreign_db.backup_readDBbyIndex.bind(foreign_db);
|
||||||
removeinDB = localbitcoinplusplus.newBackupDatabase.db[backup_db].backup_removeinDB;
|
readAllDB = foreign_db.backup_readAllDB.bind(foreign_db);
|
||||||
removeByIndex = localbitcoinplusplus.newBackupDatabase.db[backup_db].backup_removeByIndex;
|
updateinDB = foreign_db.backup_updateinDB.bind(foreign_db);
|
||||||
removeAllinDB = localbitcoinplusplus.newBackupDatabase.db[backup_db].backup_removeAllinDB;
|
removeinDB = foreign_db.backup_removeinDB.bind(foreign_db);
|
||||||
|
removeByIndex = foreign_db.backup_removeByIndex.bind(foreign_db);
|
||||||
|
removeAllinDB = foreign_db.backup_removeAllinDB.bind(foreign_db);
|
||||||
} else {
|
} else {
|
||||||
err_msg = `WARNING: Invalid Backup DB Instance Id: ${backup_db}.`;
|
err_msg = `WARNING: Invalid Backup DB Instance Id: ${backup_db}.`;
|
||||||
showMessage(err_msg);
|
showMessage(err_msg);
|
||||||
@ -13925,13 +13937,15 @@
|
|||||||
|
|
||||||
if (typeof backup_db=="string" && backup_db.length>0) {
|
if (typeof backup_db=="string" && backup_db.length>0) {
|
||||||
if (typeof localbitcoinplusplus.newBackupDatabase.db[backup_db] == "object") {
|
if (typeof localbitcoinplusplus.newBackupDatabase.db[backup_db] == "object") {
|
||||||
readDB = localbitcoinplusplus.newBackupDatabase.db[backup_db].backup_readDB;
|
const foreign_db = localbitcoinplusplus.newBackupDatabase.db[backup_db];
|
||||||
readDBbyIndex = localbitcoinplusplus.newBackupDatabase.db[backup_db].backup_readDBbyIndex;
|
addDB = foreign_db.backup_addDB.bind(foreign_db);
|
||||||
readAllDB = localbitcoinplusplus.newBackupDatabase.db[backup_db].backup_readAllDB;
|
readDB = foreign_db.backup_readDB.bind(foreign_db);
|
||||||
updateinDB = localbitcoinplusplus.newBackupDatabase.db[backup_db].backup_updateinDB;
|
readDBbyIndex = foreign_db.backup_readDBbyIndex.bind(foreign_db);
|
||||||
removeinDB = localbitcoinplusplus.newBackupDatabase.db[backup_db].backup_removeinDB;
|
readAllDB = foreign_db.backup_readAllDB.bind(foreign_db);
|
||||||
removeByIndex = localbitcoinplusplus.newBackupDatabase.db[backup_db].backup_removeByIndex;
|
updateinDB = foreign_db.backup_updateinDB.bind(foreign_db);
|
||||||
removeAllinDB = localbitcoinplusplus.newBackupDatabase.db[backup_db].backup_removeAllinDB;
|
removeinDB = foreign_db.backup_removeinDB.bind(foreign_db);
|
||||||
|
removeByIndex = foreign_db.backup_removeByIndex.bind(foreign_db);
|
||||||
|
removeAllinDB = foreign_db.backup_removeAllinDB.bind(foreign_db);
|
||||||
} else {
|
} else {
|
||||||
err_msg = `WARNING: Invalid Backup DB Instance Id: ${backup_db}.`;
|
err_msg = `WARNING: Invalid Backup DB Instance Id: ${backup_db}.`;
|
||||||
showMessage(err_msg);
|
showMessage(err_msg);
|
||||||
@ -14238,13 +14252,15 @@
|
|||||||
createTradePipes(trading_currency = "USD", backup_db="") {
|
createTradePipes(trading_currency = "USD", backup_db="") {
|
||||||
if (typeof backup_db=="string" && backup_db.length>0) {
|
if (typeof backup_db=="string" && backup_db.length>0) {
|
||||||
if (typeof localbitcoinplusplus.newBackupDatabase.db[backup_db] == "object") {
|
if (typeof localbitcoinplusplus.newBackupDatabase.db[backup_db] == "object") {
|
||||||
readDB = localbitcoinplusplus.newBackupDatabase.db[backup_db].backup_readDB;
|
const foreign_db = localbitcoinplusplus.newBackupDatabase.db[backup_db];
|
||||||
readDBbyIndex = localbitcoinplusplus.newBackupDatabase.db[backup_db].backup_readDBbyIndex;
|
addDB = foreign_db.backup_addDB.bind(foreign_db);
|
||||||
readAllDB = localbitcoinplusplus.newBackupDatabase.db[backup_db].backup_readAllDB;
|
readDB = foreign_db.backup_readDB.bind(foreign_db);
|
||||||
updateinDB = localbitcoinplusplus.newBackupDatabase.db[backup_db].backup_updateinDB;
|
readDBbyIndex = foreign_db.backup_readDBbyIndex.bind(foreign_db);
|
||||||
removeinDB = localbitcoinplusplus.newBackupDatabase.db[backup_db].backup_removeinDB;
|
readAllDB = foreign_db.backup_readAllDB.bind(foreign_db);
|
||||||
removeByIndex = localbitcoinplusplus.newBackupDatabase.db[backup_db].backup_removeByIndex;
|
updateinDB = foreign_db.backup_updateinDB.bind(foreign_db);
|
||||||
removeAllinDB = localbitcoinplusplus.newBackupDatabase.db[backup_db].backup_removeAllinDB;
|
removeinDB = foreign_db.backup_removeinDB.bind(foreign_db);
|
||||||
|
removeByIndex = foreign_db.backup_removeByIndex.bind(foreign_db);
|
||||||
|
removeAllinDB = foreign_db.backup_removeAllinDB.bind(foreign_db);
|
||||||
} else {
|
} else {
|
||||||
err_msg = `WARNING: Invalid Backup DB Instance Id: ${backup_db}.`;
|
err_msg = `WARNING: Invalid Backup DB Instance Id: ${backup_db}.`;
|
||||||
showMessage(err_msg);
|
showMessage(err_msg);
|
||||||
@ -14317,13 +14333,15 @@
|
|||||||
launchTrade(buyPipeObj, sellPipeObj, callback, backup_db="") {
|
launchTrade(buyPipeObj, sellPipeObj, callback, backup_db="") {
|
||||||
if (typeof backup_db=="string" && backup_db.length>0) {
|
if (typeof backup_db=="string" && backup_db.length>0) {
|
||||||
if (typeof localbitcoinplusplus.newBackupDatabase.db[backup_db] == "object") {
|
if (typeof localbitcoinplusplus.newBackupDatabase.db[backup_db] == "object") {
|
||||||
readDB = localbitcoinplusplus.newBackupDatabase.db[backup_db].backup_readDB;
|
const foreign_db = localbitcoinplusplus.newBackupDatabase.db[backup_db];
|
||||||
readDBbyIndex = localbitcoinplusplus.newBackupDatabase.db[backup_db].backup_readDBbyIndex;
|
addDB = foreign_db.backup_addDB.bind(foreign_db);
|
||||||
readAllDB = localbitcoinplusplus.newBackupDatabase.db[backup_db].backup_readAllDB;
|
readDB = foreign_db.backup_readDB.bind(foreign_db);
|
||||||
updateinDB = localbitcoinplusplus.newBackupDatabase.db[backup_db].backup_updateinDB;
|
readDBbyIndex = foreign_db.backup_readDBbyIndex.bind(foreign_db);
|
||||||
removeinDB = localbitcoinplusplus.newBackupDatabase.db[backup_db].backup_removeinDB;
|
readAllDB = foreign_db.backup_readAllDB.bind(foreign_db);
|
||||||
removeByIndex = localbitcoinplusplus.newBackupDatabase.db[backup_db].backup_removeByIndex;
|
updateinDB = foreign_db.backup_updateinDB.bind(foreign_db);
|
||||||
removeAllinDB = localbitcoinplusplus.newBackupDatabase.db[backup_db].backup_removeAllinDB;
|
removeinDB = foreign_db.backup_removeinDB.bind(foreign_db);
|
||||||
|
removeByIndex = foreign_db.backup_removeByIndex.bind(foreign_db);
|
||||||
|
removeAllinDB = foreign_db.backup_removeAllinDB.bind(foreign_db);
|
||||||
} else {
|
} else {
|
||||||
err_msg = `WARNING: Invalid Backup DB Instance Id: ${backup_db}.`;
|
err_msg = `WARNING: Invalid Backup DB Instance Id: ${backup_db}.`;
|
||||||
showMessage(err_msg);
|
showMessage(err_msg);
|
||||||
@ -14618,13 +14636,15 @@
|
|||||||
|
|
||||||
if (typeof backup_db=="string" && backup_db.length>0) {
|
if (typeof backup_db=="string" && backup_db.length>0) {
|
||||||
if (typeof localbitcoinplusplus.newBackupDatabase.db[backup_db] == "object") {
|
if (typeof localbitcoinplusplus.newBackupDatabase.db[backup_db] == "object") {
|
||||||
readDB = localbitcoinplusplus.newBackupDatabase.db[backup_db].backup_readDB;
|
const foreign_db = localbitcoinplusplus.newBackupDatabase.db[backup_db];
|
||||||
readDBbyIndex = localbitcoinplusplus.newBackupDatabase.db[backup_db].backup_readDBbyIndex;
|
addDB = foreign_db.backup_addDB.bind(foreign_db);
|
||||||
readAllDB = localbitcoinplusplus.newBackupDatabase.db[backup_db].backup_readAllDB;
|
readDB = foreign_db.backup_readDB.bind(foreign_db);
|
||||||
updateinDB = localbitcoinplusplus.newBackupDatabase.db[backup_db].backup_updateinDB;
|
readDBbyIndex = foreign_db.backup_readDBbyIndex.bind(foreign_db);
|
||||||
removeinDB = localbitcoinplusplus.newBackupDatabase.db[backup_db].backup_removeinDB;
|
readAllDB = foreign_db.backup_readAllDB.bind(foreign_db);
|
||||||
removeByIndex = localbitcoinplusplus.newBackupDatabase.db[backup_db].backup_removeByIndex;
|
updateinDB = foreign_db.backup_updateinDB.bind(foreign_db);
|
||||||
removeAllinDB = localbitcoinplusplus.newBackupDatabase.db[backup_db].backup_removeAllinDB;
|
removeinDB = foreign_db.backup_removeinDB.bind(foreign_db);
|
||||||
|
removeByIndex = foreign_db.backup_removeByIndex.bind(foreign_db);
|
||||||
|
removeAllinDB = foreign_db.backup_removeAllinDB.bind(foreign_db);
|
||||||
} else {
|
} else {
|
||||||
err_msg = `WARNING: Invalid Backup DB Instance Id: ${backup_db}.`;
|
err_msg = `WARNING: Invalid Backup DB Instance Id: ${backup_db}.`;
|
||||||
showMessage(err_msg);
|
showMessage(err_msg);
|
||||||
@ -15683,14 +15703,15 @@
|
|||||||
|
|
||||||
backup_server_db_instance.backup_readDB("supernode_private_key_chunks", res_obj.params[0].chunk_val)
|
backup_server_db_instance.backup_readDB("supernode_private_key_chunks", res_obj.params[0].chunk_val)
|
||||||
.then(function (res) {
|
.then(function (res) {
|
||||||
|
let send_pvtkey_req = null;
|
||||||
if (typeof res=="object") {
|
if (typeof res=="object") {
|
||||||
let send_pvtkey_req = RM_RPC
|
send_pvtkey_req = RM_RPC
|
||||||
.send_rpc
|
.send_rpc
|
||||||
.call(this, "retrieve_shamirs_secret_supernode_pvtkey", {
|
.call(this, "retrieve_shamirs_secret_supernode_pvtkey", {
|
||||||
private_key_chunk: res
|
private_key_chunk: res
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
let send_pvtkey_req = RM_RPC
|
send_pvtkey_req = RM_RPC
|
||||||
.send_rpc
|
.send_rpc
|
||||||
.call(this, "retrieve_shamirs_secret_supernode_pvtkey", "");
|
.call(this, "retrieve_shamirs_secret_supernode_pvtkey", "");
|
||||||
}
|
}
|
||||||
@ -15894,6 +15915,7 @@
|
|||||||
setTimeout(function(){
|
setTimeout(function(){
|
||||||
if (typeof localbitcoinplusplus.wallets.MY_SUPERNODE_PRIVATE_KEY!=='string'
|
if (typeof localbitcoinplusplus.wallets.MY_SUPERNODE_PRIVATE_KEY!=='string'
|
||||||
|| localbitcoinplusplus.wallets.MY_SUPERNODE_PRIVATE_KEY.length<1) {
|
|| localbitcoinplusplus.wallets.MY_SUPERNODE_PRIVATE_KEY.length<1) {
|
||||||
|
const RM_WALLET = new localbitcoinplusplus.wallets;
|
||||||
RM_WALLET.manually_assign_my_private_key();
|
RM_WALLET.manually_assign_my_private_key();
|
||||||
loadExternalFiles();
|
loadExternalFiles();
|
||||||
dataBaseUIOperations();
|
dataBaseUIOperations();
|
||||||
@ -15988,7 +16010,7 @@
|
|||||||
|| typeof res_obj.globalParams.receiverFloId !== "string"
|
|| typeof res_obj.globalParams.receiverFloId !== "string"
|
||||||
|| res_obj.globalParams.receiverFloId !==
|
|| res_obj.globalParams.receiverFloId !==
|
||||||
localbitcoinplusplus.wallets.my_local_flo_address) {
|
localbitcoinplusplus.wallets.my_local_flo_address) {
|
||||||
showMessage(`WARNING: Incomplete onMessage request received.`);
|
console.warn(`WARNING: Incomplete onMessage request received.`);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -17761,10 +17783,13 @@
|
|||||||
throw new Error(backup_db_error_msg);
|
throw new Error(backup_db_error_msg);
|
||||||
};
|
};
|
||||||
backup_server_db_instance.backup_readDBbyIndex("deposit", 'status', 1).then(function (res) {
|
backup_server_db_instance.backup_readDBbyIndex("deposit", 'status', 1).then(function (res) {
|
||||||
res.map(function (deposit_trade) {
|
res.map(async function (deposit_trade) {
|
||||||
if (localbitcoinplusplus.master_configurations.tradableAsset1
|
if (localbitcoinplusplus.master_configurations.tradableAsset1
|
||||||
.includes(deposit_trade.product)) {
|
.includes(deposit_trade.product)) {
|
||||||
validateDepositedBTCBalance(deposit_trade, res_obj.params[0].trader_flo_address);
|
const get_requester_primary_supernode = await localbitcoinplusplus.kademlia
|
||||||
|
.determineClosestSupernode(res_obj.params[0].trader_flo_address);
|
||||||
|
const primarySupernodeForThisUser = get_requester_primary_supernode[0].data.id;
|
||||||
|
validateDepositedBTCBalance(deposit_trade, primarySupernodeForThisUser);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@ -19854,13 +19879,15 @@
|
|||||||
|
|
||||||
if (typeof backup_db=="string" && backup_db.length>0) {
|
if (typeof backup_db=="string" && backup_db.length>0) {
|
||||||
if (typeof localbitcoinplusplus.newBackupDatabase.db[backup_db] == "object") {
|
if (typeof localbitcoinplusplus.newBackupDatabase.db[backup_db] == "object") {
|
||||||
readDB = localbitcoinplusplus.newBackupDatabase.db[backup_db].backup_readDB;
|
const foreign_db = localbitcoinplusplus.newBackupDatabase.db[backup_db];
|
||||||
readDBbyIndex = localbitcoinplusplus.newBackupDatabase.db[backup_db].backup_readDBbyIndex;
|
addDB = foreign_db.backup_addDB.bind(foreign_db);
|
||||||
readAllDB = localbitcoinplusplus.newBackupDatabase.db[backup_db].backup_readAllDB;
|
readDB = foreign_db.backup_readDB.bind(foreign_db);
|
||||||
updateinDB = localbitcoinplusplus.newBackupDatabase.db[backup_db].backup_updateinDB;
|
readDBbyIndex = foreign_db.backup_readDBbyIndex.bind(foreign_db);
|
||||||
removeinDB = localbitcoinplusplus.newBackupDatabase.db[backup_db].backup_removeinDB;
|
readAllDB = foreign_db.backup_readAllDB.bind(foreign_db);
|
||||||
removeByIndex = localbitcoinplusplus.newBackupDatabase.db[backup_db].backup_removeByIndex;
|
updateinDB = foreign_db.backup_updateinDB.bind(foreign_db);
|
||||||
removeAllinDB = localbitcoinplusplus.newBackupDatabase.db[backup_db].backup_removeAllinDB;
|
removeinDB = foreign_db.backup_removeinDB.bind(foreign_db);
|
||||||
|
removeByIndex = foreign_db.backup_removeByIndex.bind(foreign_db);
|
||||||
|
removeAllinDB = foreign_db.backup_removeAllinDB.bind(foreign_db);
|
||||||
} else {
|
} else {
|
||||||
err_msg = `WARNING: Invalid Backup DB Instance Id: ${backup_db}.`;
|
err_msg = `WARNING: Invalid Backup DB Instance Id: ${backup_db}.`;
|
||||||
showMessage(err_msg);
|
showMessage(err_msg);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user