Skip to content

Commit

Permalink
FIX: Send BTC should ignore non-onchain wallets
Browse files Browse the repository at this point in the history
  • Loading branch information
marcosrdz authored and Overtorment committed Feb 21, 2019
1 parent 48ddb70 commit 58d2919
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions screen/send/details.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import Modal from 'react-native-modal';
import NetworkTransactionFees, { NetworkTransactionFee } from '../../models/networkTransactionFees';
import BitcoinBIP70TransactionDecode from '../../bip70/bip70';
import { BitcoinUnit } from '../../models/bitcoinUnits';
import { HDLegacyP2PKHWallet, HDSegwitP2SHWallet } from '../../class';
import { HDLegacyP2PKHWallet, HDSegwitP2SHWallet, LightningCustodianWallet } from '../../class';
import ReactNativeHapticFeedback from 'react-native-haptic-feedback';
const bip21 = require('bip21');
let BigNumber = require('bignumber.js');
Expand Down Expand Up @@ -61,13 +61,17 @@ export default class SendDetails extends Component {
if (props.navigation.state.params) fromSecret = props.navigation.state.params.fromSecret;
let fromWallet = null;

const wallets = BlueApp.getWallets();
const wallets = BlueApp.getWallets().filter(wallet => wallet.type !== LightningCustodianWallet.type);

if (wallets.length === 0) {
alert('Before creating a transaction, you must first add a Bitcoin wallet.');
return props.navigation.goBack(null);
} else {
if (!fromWallet && wallets.length > 0) fromWallet = wallets[0];
if (!fromWallet && wallets.length > 0) {
fromWallet = wallets[0];
fromAddress = fromWallet.getAddress();
fromSecret = fromWallet.getSecret();
}
if (fromWallet === null) return props.navigation.goBack(null);
for (let w of wallets) {
if (w.getSecret() === fromSecret) {
Expand Down

0 comments on commit 58d2919

Please sign in to comment.