@node-dlc/wire
Version:
Lightning Network Wire Protocol
28 lines • 1.24 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.GossipError = exports.GossipErrorCode = void 0;
var GossipErrorCode;
(function (GossipErrorCode) {
GossipErrorCode[GossipErrorCode["Unknown"] = 0] = "Unknown";
GossipErrorCode[GossipErrorCode["PeerNotReady"] = 1] = "PeerNotReady";
GossipErrorCode[GossipErrorCode["ReplyChannelRangeNoInformation"] = 2] = "ReplyChannelRangeNoInformation";
GossipErrorCode[GossipErrorCode["ReplyChannelsNoInfo"] = 3] = "ReplyChannelsNoInfo";
})(GossipErrorCode = exports.GossipErrorCode || (exports.GossipErrorCode = {}));
class GossipError extends Error {
constructor(code, wireMessage) {
let message = 'Unknown gossip error';
switch (code) {
case GossipErrorCode.ReplyChannelRangeNoInformation:
message = 'reply_channel_range had no information';
break;
case GossipErrorCode.ReplyChannelsNoInfo:
message = 'reply_short_channel_ids_end had no information';
break;
}
super(message);
this.code = code;
this.wireMessage = wireMessage;
}
}
exports.GossipError = GossipError;
//# sourceMappingURL=GossipError.js.map