xmr/wow restore height fix

This commit is contained in:
julian 2024-01-17 13:10:23 -06:00
parent 4356e101f5
commit 48ee44ed29
2 changed files with 4 additions and 24 deletions

View file

@ -1,4 +1,5 @@
import 'dart:async';
import 'dart:math';
import 'package:cw_core/monero_transaction_priority.dart';
import 'package:cw_core/node.dart';
@ -347,19 +348,7 @@ class MoneroWallet extends CryptonoteWallet with CwBasedInterface {
}
try {
int height = info.restoreHeight;
// 25 word seed. TODO validate
if (height == 0) {
height = xmr_dart.monero.getHeigthByDate(
date: DateTime.now().subtract(
const Duration(
// subtract a couple days to ensure we have a buffer for SWB
days: 2,
),
),
);
}
final height = max(info.restoreHeight, 0);
await info.updateRestoreHeight(
newRestoreHeight: height,

View file

@ -1,4 +1,5 @@
import 'dart:async';
import 'dart:math';
import 'package:cw_core/monero_transaction_priority.dart';
import 'package:cw_core/node.dart';
@ -394,17 +395,7 @@ class WowneroWallet extends CryptonoteWallet with CwBasedInterface {
if (seedLength == 14) {
height = getSeedHeightSync(mnemonic.trim());
} else {
// 25 word seed. TODO validate
if (height == 0) {
height = wow_dart.wownero.getHeightByDate(
date: DateTime.now().subtract(
const Duration(
// subtract a couple days to ensure we have a buffer for SWB
days: 2,
),
),
);
}
height = max(height, 0);
}
// TODO: info.updateRestoreHeight