From 70da5bf71abe908cec9d2305463dce9fac8e275d Mon Sep 17 00:00:00 2001 From: supertypo Date: Fri, 6 Oct 2023 10:19:37 +0200 Subject: [PATCH] Kaspad: Add uacomment = kdx_ --- lib/interfaces/kaspad.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib/interfaces/kaspad.js b/lib/interfaces/kaspad.js index acc63db..4c873d5 100644 --- a/lib/interfaces/kaspad.js +++ b/lib/interfaces/kaspad.js @@ -5,6 +5,7 @@ const { dpc, Semaphore } = require("@aspectron/flow-async"); const utils = require("@aspectron/flow-utils"); const Daemon = require('../daemon'); const {Client:KaspaGRPC} = require('@kaspa/grpc-node'); +const pkg = require("../../package"); const natUpnp = require("@runonflux/nat-upnp"); module.exports = class Kaspad extends Daemon { @@ -50,6 +51,15 @@ module.exports = class Kaspad extends Daemon { } await new Promise(resolve => setTimeout(resolve, 500)); // Ensure "sink" has enough time to get ready to receive messages before proceeding + + if (!("uacomment" in args)) { + const uacomment = `kdx_${pkg['version']}` + this.writeToSink(`KASPAD: Adding uacomment=${uacomment} to arguments\n`); + args['uacomment'] = uacomment; + } else if (!args['uacomment']) { + delete args['uacomment']; // Allow to disable uacomment + } + if (this.task.conf['upnpEnabled'] && args['listen'] && args['listen'].indexOf(":") !== -1) { this.writeToSink(`UPNP: `+`ENABLED`.green+`. Set `+`"upnpEnabled": false`.yellow+` in Settings -> Advanced -> Service Configuration to disable\n`); const nodePort = args['listen'].split(':')[1];