mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2025-06-28 20:39:51 +00:00
Nano rep page + derivation fixes (#1655)
* minor nano derivation fixes * rep page fixes * ignore non-critical receive block errors * really be sure the derivation type is set during wallet creation
This commit is contained in:
parent
576dd49766
commit
783f1a2349
4 changed files with 80 additions and 59 deletions
|
@ -466,21 +466,25 @@ class NanoClient {
|
|||
|
||||
blocks = blocks as Map<String, dynamic>;
|
||||
|
||||
// confirm all receivable blocks:
|
||||
for (final blockHash in blocks.keys) {
|
||||
final block = blocks[blockHash];
|
||||
final String amountRaw = block["amount"] as String;
|
||||
await receiveBlock(
|
||||
blockHash: blockHash,
|
||||
amountRaw: amountRaw,
|
||||
privateKey: privateKey,
|
||||
destinationAddress: destinationAddress,
|
||||
);
|
||||
// a bit of a hack:
|
||||
await Future<void>.delayed(const Duration(seconds: 2));
|
||||
try {
|
||||
// confirm all receivable blocks:
|
||||
for (final blockHash in blocks.keys) {
|
||||
final block = blocks[blockHash];
|
||||
final String amountRaw = block["amount"] as String;
|
||||
await receiveBlock(
|
||||
blockHash: blockHash,
|
||||
amountRaw: amountRaw,
|
||||
privateKey: privateKey,
|
||||
destinationAddress: destinationAddress,
|
||||
);
|
||||
// a bit of a hack:
|
||||
await Future<void>.delayed(const Duration(seconds: 2));
|
||||
}
|
||||
return blocks.keys.length;
|
||||
} catch (_) {
|
||||
// we failed to confirm all receivable blocks for w/e reason (PoW / node outage / etc)
|
||||
return 0;
|
||||
}
|
||||
|
||||
return blocks.keys.length;
|
||||
}
|
||||
|
||||
void stop() {}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue