From 76828f129c6cb3cffc881f00c205790bccee9a34 Mon Sep 17 00:00:00 2001 From: Forky <114926085+forkyishere@users.noreply.github.com> Date: Fri, 20 Jun 2025 21:08:11 +1200 Subject: [PATCH 1/2] Fix undefined buy book market entries as null on ivm Blocks 1351741, 13552906 and 1354493 had market contract events for the orderClosed that were processing orders with txId = null, causing a divergence from what old vm2 would process. By interpreting the API calls the right way (treating undefined as undefined instead of null), this fixes the issue as those 3 (actually 4, as there is another sell one too) orders not showing the "txId" field on those 4 transactions. --- libs/SmartContracts.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/SmartContracts.js b/libs/SmartContracts.js index 913834e6..7a34430d 100644 --- a/libs/SmartContracts.js +++ b/libs/SmartContracts.js @@ -734,7 +734,7 @@ class SmartContracts { }; let getApiProp = (k) => { const v = _sscglobal_api.getSync(k, { copy: true }); - return typeof v !== 'undefined' ? v : null; + return typeof v !== 'undefined' ? v : undefined; }; let getDbProp = (k) => { const v = _sscglobal_db.getSync(k, { copy: true }); From c4342b556de98b530bb8b53182f4d5e522d4181e Mon Sep 17 00:00:00 2001 From: Forky <114926085+forkyishere@users.noreply.github.com> Date: Sat, 21 Jun 2025 12:42:55 +1200 Subject: [PATCH 2/2] Fix when mainBlock is null when not comparing with hashVerificationNode --- plugins/Blockchain.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/Blockchain.js b/plugins/Blockchain.js index 5a3caf67..5cf9b4ca 100644 --- a/plugins/Blockchain.js +++ b/plugins/Blockchain.js @@ -145,7 +145,7 @@ async function producePendingTransactions( } await addBlock(newBlock); - } else if (mainBlock.refHiveBlockNumber === newBlock.refHiveBlockNumber) { + } else if (mainBlock?.refHiveBlockNumber === newBlock.refHiveBlockNumber) { throw new Error(`Block mismatch with api \nMain: ${JSON.stringify(mainBlock, null, 2)}, \nThis: ${JSON.stringify(newBlock, null, 2)}`); } } catch (e) {