This commit is contained in:
sairajzero 2019-11-16 20:28:43 +05:30
parent 9c445a65fc
commit 0f50db3315

View File

@ -4892,7 +4892,6 @@
//Sign data using private-key //Sign data using private-key
signData: function (data, privateKeyHex) { signData: function (data, privateKeyHex) {
console.log(data)
var key = new Bitcoin.ECKey(privateKeyHex); var key = new Bitcoin.ECKey(privateKeyHex);
key.setCompressed(true); key.setCompressed(true);
@ -6263,14 +6262,13 @@
reactor.addEventListener("send_message_to_backup_nodes", function (backupMsg) { reactor.addEventListener("send_message_to_backup_nodes", function (backupMsg) {
console.log("send_message_to_backup_nodes"); console.log("send_message_to_backup_nodes");
//send message to all connected backup nodes //send message to all connected backup nodes
console.log(backupMsg)
var sendData = { var sendData = {
from: myFloID, from: myFloID,
backupMsg: backupMsg, backupMsg: backupMsg,
sign: floCrypto.signData(JSON.stringify(backupMsg), myPrivKey) sign: floCrypto.signData(JSON.stringify(backupMsg), myPrivKey)
} }
for(var i = 0; i < floGlobals.backupNodes.length; i++) for(var i = 0; i < floGlobals.backupNodes.length; i++)
floGlobals.backupNodes[i].wsConn.send(sendData) floGlobals.backupNodes[i].wsConn.send(JSON.stringify(sendData))
}) })
reactor.registerEvent("send_message_to_node"); reactor.registerEvent("send_message_to_node");
@ -6286,7 +6284,7 @@
backupMsg: event.backupMsg, backupMsg: event.backupMsg,
sign: floCrypto.signData(JSON.stringify(event.backupMsg), myPrivKey) sign: floCrypto.signData(JSON.stringify(event.backupMsg), myPrivKey)
} }
nodeWS.send(JSON.stringify(this.sendData)) nodeWS.send(JSON.stringify(sendData))
} }
if(event.bulkBackupMsg){ if(event.bulkBackupMsg){
for(var i=0; i < event.bulkBackupMsg.length; i++){ for(var i=0; i < event.bulkBackupMsg.length; i++){
@ -6295,7 +6293,7 @@
backupMsg: event.bulkBackupMsg[i], backupMsg: event.bulkBackupMsg[i],
sign: floCrypto.signData(JSON.stringify(event.bulkBackupMsg[i]), myPrivKey) sign: floCrypto.signData(JSON.stringify(event.bulkBackupMsg[i]), myPrivKey)
} }
nodeWS.send(JSON.stringify(this.sendData)) nodeWS.send(JSON.stringify(sendData))
} }
} }