mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2024-11-17 09:47:37 +00:00
xmr/wow restore height fix
This commit is contained in:
parent
4356e101f5
commit
48ee44ed29
2 changed files with 4 additions and 24 deletions
|
@ -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,
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue