Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unhandled exception leads to app crash. #125

Open
awaik opened this issue Mar 26, 2024 · 1 comment
Open

Unhandled exception leads to app crash. #125

awaik opened this issue Mar 26, 2024 · 1 comment

Comments

@awaik
Copy link

awaik commented Mar 26, 2024

When I create a transaction with the wrong utxo's - app crashes on the line

final TxBuilderResult txBuilderResultPreRes = await txBuilderPre.finish(wallet);

      final txBuilderPre = TxBuilder();

      List<(dynamic, int)> outputs = [];
      for (final fundOutput in fundOutputs) {
        final Address addressModel = await Address.create(address: fundOutput.address);
        final script = await addressModel.scriptPubKey();
        outputs.add((script, fundOutput.amount));
      }

      /// Pre-calculate fees amount
      TxBuilder txBuilderResultPre = txBuilderPre.feeRate(feeRate).manuallySelectedOnly().addUtxos(utxos);
      for (final output in outputs) {
        txBuilderResultPre = txBuilderResultPre.addRecipient(output.$1, output.$2);
      }

      final TxBuilderResult txBuilderResultPreRes = await txBuilderPre.finish(wallet);

with the message

thread 'frb_workerpool' panicked at src/r_api.rs:196:41:
called `Result::unwrap()` on an `Err` value: UnknownUtxo
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
* thread #42, name = 'frb_workerpool', stop reason = signal SIGABRT
    frame #0: 0x00000001eabdc200 libsystem_kernel.dylib`__pthread_kill + 8
libsystem_kernel.dylib`:
->  0x1eabdc200 <+8>:  b.lo   0x1eabdc220               ; <+40>
    0x1eabdc204 <+12>: pacibsp 
    0x1eabdc208 <+16>: stp    x29, x30, [sp, #-0x10]!
    0x1eabdc20c <+20>: mov    x29, sp
Target 0: (Runner) stopped.
Lost connection to device.

With correct utxo's this code works well.

  1. iOS 16.1.2
  2. bdk_flutter: ^0.30.0

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.19.2, on macOS 14.4 23E214 darwin-arm64, locale
en-DE)
[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 15.3)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2022.3)
[✓] IntelliJ IDEA Community Edition (version 2022.2.2)
[✓] VS Code (version 1.87.2)
[✓] Connected device (4 available)
[✓] Network resources

• No issues found!

@awaik
Copy link
Author

awaik commented Apr 2, 2024

And one more

thread 'frb_workerpool' panicked at src/types.rs:56:53:
Invalid Psbt Input: Error("key must be a string", line: 1, column: 2)
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
* thread #42, name = 'frb_workerpool', stop reason = signal SIGABRT
    frame #0: 0x00000001c534c200 libsystem_kernel.dylib`__pthread_kill + 8
libsystem_kernel.dylib`:
->  0x1c534c200 <+8>:  b.lo   0x1c534c220               ; <+40>
    0x1c534c204 <+12>: pacibsp 
    0x1c534c208 <+16>: stp    x29, x30, [sp, #-0x10]!
    0x1c534c20c <+20>: mov    x29, sp
Target 0: (Runner) stopped.
Lost connection to device.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant