wallet-core: report coins in dump-coins even when withdrawal transaction was deleted

This commit is contained in:
Florian Dold 2023-02-14 12:30:44 +01:00
parent 6a4da88719
commit 97fac057c2
No known key found for this signature in database
GPG Key ID: D2E4F00F29D02A4B

View File

@ -910,7 +910,7 @@ async function dumpCoins(ws: InternalWalletState): Promise<CoinDumpJson> {
c.denomPubHash, c.denomPubHash,
]); ]);
if (!denom) { if (!denom) {
console.error("no denom session found for coin"); logger.warn("no denom found for coin");
continue; continue;
} }
const cs = c.coinSource; const cs = c.coinSource;
@ -920,12 +920,7 @@ async function dumpCoins(ws: InternalWalletState): Promise<CoinDumpJson> {
} }
let withdrawalReservePub: string | undefined; let withdrawalReservePub: string | undefined;
if (cs.type == CoinSourceType.Withdraw) { if (cs.type == CoinSourceType.Withdraw) {
const ws = await tx.withdrawalGroups.get(cs.withdrawalGroupId); withdrawalReservePub = cs.reservePub;
if (!ws) {
console.error("no withdrawal session found for coin");
continue;
}
withdrawalReservePub = ws.reservePub;
} }
const denomInfo = await ws.getDenomInfo( const denomInfo = await ws.getDenomInfo(
ws, ws,
@ -934,7 +929,7 @@ async function dumpCoins(ws: InternalWalletState): Promise<CoinDumpJson> {
c.denomPubHash, c.denomPubHash,
); );
if (!denomInfo) { if (!denomInfo) {
console.error("no denomination found for coin"); logger.warn("no denomination found for coin");
continue; continue;
} }
coinsJson.coins.push({ coinsJson.coins.push({