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 }); 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) {