Skip to content

Commit d6207b0

Browse files
committed
fix loop over nullish; quiet getChain error noise for old wallets
1 parent af4e90c commit d6207b0

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

packages/bitcore-wallet-service/src/lib/chain/index.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,9 @@ class ChainProxy {
9898
*/
9999
getChain(coin: string): string {
100100
try {
101+
if (coin === undefined) { // This happens frequently for very old btc wallets/addresses
102+
return Defaults.CHAIN;
103+
}
101104
// TODO add a warning that we are not including chain
102105
let normalizedChain = coin.toLowerCase();
103106
if (

packages/bitcore-wallet-service/src/lib/server.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3897,7 +3897,7 @@ export class WalletService implements IWalletService {
38973897
tx.actions = proposal.actions.map(action => {
38983898
return _.pick(action, ['createdOn', 'type', 'copayerId', 'copayerName', 'comment']);
38993899
});
3900-
for (const output of tx.outputs) {
3900+
for (const output of tx.outputs || []) {
39013901
const query = {
39023902
toAddress: output.address,
39033903
amount: output.amount

0 commit comments

Comments
 (0)