Skip to content

Commit

Permalink
Merge pull request #374 from kumulynja/fix-issue-370-init-receiver-error
Browse files Browse the repository at this point in the history
fix: only init payjoin when payment network is bitcoin
  • Loading branch information
mocodesmo authored Dec 23, 2024
2 parents 50dd373 + 168c97f commit 82a9986
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/receive/bloc/receive_cubit.dart
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ class ReceiveCubit extends Cubit<ReceiveState> {

if (state.paymentNetwork == PaymentNetwork.lightning) {
emit(state.copyWith(defaultAddress: null));
return;
}

if (!walletBloc.state.wallet!.mainWallet) {
Expand All @@ -63,7 +64,9 @@ class ReceiveCubit extends Cubit<ReceiveState> {
// if (watchOnly)
// emit(state.copyWith(paymentNetwork: ReceivePaymentNetwork.bitcoin));
await loadAddress();
if (state.defaultAddress != null) {

if (state.paymentNetwork == PaymentNetwork.bitcoin &&
state.defaultAddress != null) {
receivePayjoin(
state.walletBloc!.state.wallet!.isTestnet(),
state.defaultAddress!.address,
Expand Down

0 comments on commit 82a9986

Please sign in to comment.