update user outputs
This commit is contained in:
parent
3330baefc1
commit
a6f4a5122c
@ -323,6 +323,29 @@ class Services {
|
||||
return [];
|
||||
}
|
||||
}
|
||||
|
||||
public async updateOwnedOutputsForUser(preId: string): Promise<void> {
|
||||
const services = await Services.getInstance();
|
||||
let latest_outputs: outputs_list;
|
||||
try {
|
||||
latest_outputs = services.sdkClient.get_outpoints_for_user(preId);
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
const indexedDB = await IndexedDB.getInstance();
|
||||
const db = await indexedDB.getDb();
|
||||
const storeName = indexedDB.getStoreList().AnkUser;
|
||||
let user = await indexedDB.getObject<User>(db, storeName, preId);
|
||||
user.outputs = latest_outputs;
|
||||
await indexedDB.setObject(db, storeName, user, null);
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
}
|
||||
}
|
||||
|
||||
public async checkTransaction(tx: string, tweak_data: string, blkheight: number): Promise<string | null> {
|
||||
const services = await Services.getInstance();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user