Browse Source

chan id, fix node_pubkey encoding

master^2
Evan Feenstra 4 years ago
parent
commit
74c62b41e0
  1. 3
      dist/src/controllers/queries.js
  2. 2
      dist/src/controllers/queries.js.map
  3. 6
      dist/src/utils/lightning.js
  4. 2
      dist/src/utils/lightning.js.map
  5. 2
      dist/src/utils/setup.js.map
  6. 3
      src/controllers/queries.ts
  7. 6
      src/utils/lightning.ts
  8. 1
      src/utils/setup.ts

3
dist/src/controllers/queries.js

@ -147,7 +147,7 @@ function checkForConfirmedChannels() {
return; // this shouldnt happen
if (!rec.fundingTxid)
return;
checkChannelsAndKeysend(rec);
yield checkChannelsAndKeysend(rec);
}));
});
}
@ -174,6 +174,7 @@ function checkChannelsAndKeysend(rec) {
console.log('[WATCH] complete! Updating accounting, id:', rec.id);
models_1.models.Accounting.update({
status: constants_1.default.statuses.confirmed,
chanId: chan.chan_id
}, {
where: { id: rec.id }
});

2
dist/src/controllers/queries.js.map

File diff suppressed because one or more lines are too long

6
dist/src/utils/lightning.js

@ -509,9 +509,13 @@ function listChannels(args) {
exports.listChannels = listChannels;
function openChannel(args) {
return __awaiter(this, void 0, void 0, function* () {
const opts = args || {};
if (args && args.node_pubkey) {
opts.node_pubkey = ByteBuffer.fromHex(args.node_pubkey);
}
return new Promise((resolve, reject) => {
const lightning = loadLightning();
lightning.openChannelSync(args, function (err, response) {
lightning.openChannelSync(opts, function (err, response) {
if (err == null) {
resolve(response);
}

2
dist/src/utils/lightning.js.map

File diff suppressed because one or more lines are too long

2
dist/src/utils/setup.js.map

File diff suppressed because one or more lines are too long

3
src/controllers/queries.ts

@ -141,7 +141,7 @@ async function checkForConfirmedChannels(){
if (rec.amount <= 0) return // needs amount
if (!rec.pubkey) return // this shouldnt happen
if (!rec.fundingTxid) return
checkChannelsAndKeysend(rec)
await checkChannelsAndKeysend(rec)
})
}
@ -167,6 +167,7 @@ async function checkChannelsAndKeysend(rec: Accounting){
console.log('[WATCH] complete! Updating accounting, id:', rec.id)
models.Accounting.update({
status: constants.statuses.confirmed,
chanId: chan.chan_id
}, {
where: { id: rec.id }
})

6
src/utils/lightning.ts

@ -465,9 +465,13 @@ export interface OpenChannelArgs {
sat_per_byte: number // 75?
}
export async function openChannel(args: OpenChannelArgs): Promise<{ [k: string]: any }> {
const opts = args||{}
if(args && args.node_pubkey) {
opts.node_pubkey = ByteBuffer.fromHex(args.node_pubkey)
}
return new Promise((resolve, reject) => {
const lightning = loadLightning()
lightning.openChannelSync(args, function (err, response) {
lightning.openChannelSync(opts, function (err, response) {
if (err == null) {
resolve(response)
} else {

1
src/utils/setup.ts

@ -34,7 +34,6 @@ async function migrate() {
addTableColumn('sphinx_accountings', 'funding_txid')
addTableColumn('sphinx_chat_members', 'last_alias')
addTableColumn('sphinx_chats', 'my_photo_url')

Loading…
Cancel
Save