Skip to content

Handling mempool min fee not met error #135

Open
@saiy2k

Description

@saiy2k

bdk version: 0.31.2-dev.1

With the following code:

try {
  [...]
  await builder.feeRate(0).addRecipient(script, 900).finish(bdkWallet);
} on FeeTooLowException catch (e) {
  print('FeeTooLowException');
  print(e);
} on FeeRateTooLowException catch (e) {
  print('FeeRateTooLowException');
  print(e);
} on RpcException catch (e) {
  print('RpcException');
  print(e);
} on Exception catch (e) {
  print('Exception');
  print(e);
}

No typed Exception is being thrown.

There are typed Exceptions like FeeTooLowException, FeeRateTooLowException (or) since it looks like an RPC error, RpcException could be thrown.

The log goes as follows:
BdkError.electrum(field0: Electrum server error: "sendrawtransaction RPC error: {\"code\":-26,\"message\":\"mempool min fee not met, 0 < 13169\"}")

Basically I am trying to get the JSON object {\"code\":-26,\"message\":\"mempool min fee not met, 0 < 13169\"}") embedded inside the error string.

To simulate the issue:
https://github.com/saiy2k/Bdk-flutter-Exception-handler

Run the app and press the + floating action button.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions