Skip to content

Commit c26fc2f

Browse files
committed
Fix crash when memletConfig not provided
This is necessary on NodeJS deployments when there's no nativeIo
1 parent 075d466 commit c26fc2f

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
## Unreleased
44

5+
- fixed: Crash when running under NodeJS due to missing memletConfig
6+
57
## 3.8.2 (2025-06-09)
68

79
- changed: Remove NOWNodes blockbook connection for Firo.

src/common/plugin/CurrencyPlugin.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,19 @@ export function makeCurrencyPlugin(
4242
})
4343

4444
if (!hasMemletBeenSet) {
45-
const { memletConfig } = nativeIo[
45+
const pluginConfig = nativeIo[
4646
'edge-currency-plugins'
4747
] as EdgeCurrencyPluginNativeIo
4848

49+
const memletConfig = pluginConfig?.memletConfig
50+
4951
if (memletConfig != null) {
5052
hasMemletBeenSet = true
5153
setMemletConfig(memletConfig)
54+
} else {
55+
setMemletConfig({
56+
maxMemoryUsage: 50 * 1024 * 1024 // 50MB
57+
})
5258
}
5359
}
5460

0 commit comments

Comments
 (0)