@node-lightning/wire
Version:
Lightning Network Wire Protocol
17 lines • 666 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.deserializeTor2 = void 0;
const AddressTor2_1 = require("../../domain/AddressTor2");
const torStringFromBuffer_1 = require("./torStringFromBuffer");
/**
* Deserializes a TOR v2 address from a reader and
* returns an instance of a AddressTor2.
*/
function deserializeTor2(reader) {
const hostBytes = reader.readBytes(10);
const port = reader.readUInt16BE();
const host = torStringFromBuffer_1.torStringFromBuffer(hostBytes);
return new AddressTor2_1.AddressTor2(host, port);
}
exports.deserializeTor2 = deserializeTor2;
//# sourceMappingURL=deserializeTor2.js.map