Compare commits
2 Commits
e0e186f4f4
...
63ee4ce719
Author | SHA1 | Date | |
---|---|---|---|
![]() |
63ee4ce719 | ||
![]() |
acb9739a80 |
@ -944,7 +944,20 @@ export default class Services {
|
|||||||
// This is existing device, we need to catch up if last_scan is lagging behind chain_tip
|
// This is existing device, we need to catch up if last_scan is lagging behind chain_tip
|
||||||
if (device.sp_wallet.last_scan < this.currentBlockHeight) {
|
if (device.sp_wallet.last_scan < this.currentBlockHeight) {
|
||||||
// We need to catch up
|
// We need to catch up
|
||||||
await this.sdkClient.scan_blocks(this.currentBlockHeight, BLINDBITURL);
|
try {
|
||||||
|
await this.sdkClient.scan_blocks(this.currentBlockHeight, BLINDBITURL);
|
||||||
|
} catch (e) {
|
||||||
|
console.error(`Failed to scan blocks: ${e}`);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// If everything went well, we can update our storage
|
||||||
|
try {
|
||||||
|
const device = this.dumpDeviceFromMemory();
|
||||||
|
await this.saveDeviceInDatabase(device);
|
||||||
|
} catch (e) {
|
||||||
|
console.error(`Failed to save updated device: ${e}`);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
// Up to date, just returns
|
// Up to date, just returns
|
||||||
return;
|
return;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user