@node-lightning/graph
Version:
Lightning Network P2P Graph
23 lines • 810 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.channelFromMessage = void 0;
const channel_1 = require("../channel");
/**
* Constructs an incomplete channel from a node announcement message. The channel does
* not include outpoint, capacity, or per node settings found in channel_update
* messages. These values need to be set elsewhere.
*/
function channelFromMessage(msg) {
const c = new channel_1.Channel();
c.shortChannelId = msg.shortChannelId;
c.features = msg.features;
c.nodeId1 = msg.nodeId1;
c.nodeId2 = msg.nodeId2;
if ("outpoint" in msg) {
c.channelPoint = msg.outpoint;
c.capacity = msg.capacity;
}
return c;
}
exports.channelFromMessage = channelFromMessage;
//# sourceMappingURL=channel-from-message.js.map