Skip to content

Commit

Permalink
add logging in case local address has not been derived yet
Browse files Browse the repository at this point in the history
  • Loading branch information
kajoseph committed Aug 13, 2024
1 parent 3e2d392 commit c96af14
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/bitcore-client/bin/wallet-check
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,12 @@ const main = async () => {
} else {
const address = wallet.deriveAddress(wallet.addressIndex - 1, false);
const addressObj = await wallet.getLocalAddress(address);
console.log(`Last local address: ${address} (${addressObj?.path || `m/0/${wallet.addressIndex - 1}`})`);
if (!addressObj) {
console.log('Local address not found at index ' + (wallet.addressIndex - 1));
console.log(`Run \`wallet derive --name <name> --startIdx ${wallet.addressIndex - 1}\` and try again.`);
} else {
console.log(`Last local address: ${address} (${addressObj?.path || `m/0/${wallet.addressIndex - 1}`})`);
}
}

if (index) {
Expand Down

0 comments on commit c96af14

Please sign in to comment.