Browse Source

sig is optional

feature/dockerfile-arm
Evan Feenstra 5 years ago
parent
commit
c62879972b
  1. 5
      api/network/receive.ts
  2. 5
      dist/api/network/receive.js
  3. 2
      dist/api/network/receive.js.map

5
api/network/receive.ts

@ -136,19 +136,16 @@ async function parseAndVerifyPayload(data){
try {
payload = JSON.parse(msg)
if(payload) {
const v = await verifyAscii(msg, sig+'a')
console.log(v)
const v = await verifyAscii(msg, sig)
if(v && v.valid && v.pubkey) {
payload.sender = payload.sender||{}
payload.sender.pub_key=v.pubkey
return payload
} else {
console.log('return payload',payload)
return payload // => RM THIS
}
}
} catch(e) {
console.log('err',e)
if(payload) return payload // => RM THIS
return null
}

5
dist/api/network/receive.js

@ -156,21 +156,18 @@ function parseAndVerifyPayload(data) {
try {
payload = JSON.parse(msg);
if (payload) {
const v = yield lightning_2.verifyAscii(msg, sig + 'a');
console.log(v);
const v = yield lightning_2.verifyAscii(msg, sig);
if (v && v.valid && v.pubkey) {
payload.sender = payload.sender || {};
payload.sender.pub_key = v.pubkey;
return payload;
}
else {
console.log('return payload', payload);
return payload; // => RM THIS
}
}
}
catch (e) {
console.log('err', e);
if (payload)
return payload; // => RM THIS
return null;

2
dist/api/network/receive.js.map

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save