Skip to content

Commit

Permalink
refactor: added an error when wallet is ready but index was not found
Browse files Browse the repository at this point in the history
  • Loading branch information
andreabadesso committed Dec 6, 2024
1 parent dded183 commit d43060b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/daemon/src/services/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import {
FullNodeEvent,
EventTxInput,
EventTxOutput,
WalletStatus,
} from '../types';
import {
TxInput,
Expand Down Expand Up @@ -341,7 +342,10 @@ export const handleVertexAccepted = async (context: Context, _event: Event) => {
const { maxAmongAddresses, maxWalletIndex } = indices;

if (!maxAmongAddresses || !maxWalletIndex) {
// Do nothing, this is unexpected and an error should have been logged already
// Do nothing, wallet is most likely not loaded yet.
if (walletDetails.status === WalletStatus.READY) {
logger.error('[ERROR] A wallet marked as READY does not have a max wallet index or address index was not found in the database');
}
continue;
}

Expand Down

0 comments on commit d43060b

Please sign in to comment.