Browse Source

如果symbol == 'ERR' && decimals == 0视为销毁

skyfffire 3 năm trước cách đây
mục cha
commit
271f88ebb4
1 tập tin đã thay đổi với 9 bổ sung2 xóa
  1. 9 2
      scripts/lp/lpMaintenance.ts

+ 9 - 2
scripts/lp/lpMaintenance.ts

@@ -145,8 +145,15 @@ export class LpMaintenance {
 
   updateLocalLpListR0R1(lpList: any, r0s: any, r1s: any) {
     for (let index = 0; index < lpList.length; index++) {
-      lpList[index].dataObj.r0 = r0s[index]
-      lpList[index].dataObj.r1 = r1s[index]
+      const lp = lpList[index].dataObj
+      if ((lp.symbol0 === 'ERR' && parseInt(lp.decimals0) === 0)
+      || (lp.symbol1 === 'ERR' && parseInt(lp.decimals1) === 0)) {
+        lp.r0 = 0
+        lp.r1 = 0
+      } else {
+        lp.r0 = r0s[index]
+        lp.r1 = r1s[index]
+      }
     }
   }