wallet: SendMoney does not report error correctly #14187

issue nkostoulas opened this issue on September 10, 2018
  1. nkostoulas commented at 11:29 AM on September 10, 2018: contributor

    CommitTransaction returns true even if AcceptToMemoryPool fails, thus an error is not correctly thrown in send money rpc calls. Failure of RelayWalletTransaction isn't captured either.

  2. fanquake added the label Wallet on Sep 10, 2018
  3. nkostoulas commented at 12:27 PM on September 10, 2018: contributor

    I've closed the PR. Wasn't aware of this as a use case until I saw the wallet_basic unit test.

    Would there be a case when catching the CommitTransaction error in the rpc calls would be useful?

  4. laanwj commented at 8:43 AM on September 13, 2018: member

    I think you raise a fair point, though yes, it's not entirely predetermined what should be considered an error sending.

    Temporary error conditions such as being unable to commit to the mempool (it might be accepted later) or relay (the wallet will try again later) are qualitatively different from a permanent failure which prevented the transaction from being created.

    Ideally, these could be returned as part of a result tuple. However, the function returns a bare string, not a result tuple so that would require a breaking API change.

  5. MarcoFalke commented at 10:33 PM on April 26, 2020: member

    This is already a TODO in the code, no need to keep an issue open for each TODO.

            // TODO: if we expect the failure to be long term or permanent, instead delete wtx from the wallet and return failure.
    
  6. MarcoFalke closed this on Apr 26, 2020

  7. DrahtBot locked this on Feb 15, 2022

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-21 15:15 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me