From aa4f73e750e0c3f7703d90472964e2164eeb60c9 Mon Sep 17 00:00:00 2001 From: Ivan Shumkov Date: Fri, 5 Jul 2024 19:17:50 +0700 Subject: [PATCH] fix: mn entry version deserialization --- lib/deterministicmnlist/SimplifiedMNListEntry.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/deterministicmnlist/SimplifiedMNListEntry.js b/lib/deterministicmnlist/SimplifiedMNListEntry.js index d35e4279c..e80d87d93 100644 --- a/lib/deterministicmnlist/SimplifiedMNListEntry.js +++ b/lib/deterministicmnlist/SimplifiedMNListEntry.js @@ -113,8 +113,11 @@ SimplifiedMNListEntry.fromBuffer = function fromBuffer(buffer, network) { object.nType = bufferReader.readUInt16LE(); } - if (object.nType === MASTERNODE_TYPE_HP) { + if (typeof object.nType === 'number') { object.nVersion = 2; + } + + if (object.nType === MASTERNODE_TYPE_HP) { object.platformHTTPPort = bufferReader.readUInt16LE(); object.platformNodeID = bufferReader.read(PLATFORM_NODE_ID_SIZE).reverse().toString('hex'); }