public inbox for bitcoindev@googlegroups.com
 help / color / mirror / Atom feed
From: Dustin Dettmer <dustinpaystaxes@gmail•com>
To: Bitcoin Protocol Discussion
	<bitcoin-dev@lists•linuxfoundation.org>,
	 Oscar Guindzberg <oscar.guindzberg@gmail•com>
Cc: Andreas Schildbach <andreas@schildbach•de>
Subject: Re: [bitcoin-dev] Removal of reject network messages from Bitcoin Core (BIP61)
Date: Wed, 13 Mar 2019 15:30:44 -0700	[thread overview]
Message-ID: <CABLeJxTq-KZz9K=3EgyD5sFpgNzJs_NdOLQdGv=VkGUeLcfteg@mail.gmail.com> (raw)
In-Reply-To: <CAPoHUxMfKqxH4p9gsVzHD2S29nZaQfpW=oLgVs999v4GG83uXQ@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 2177 bytes --]

I’ve solved the same problem in a different way.

1) Submit a transaction
2) Collect all reject messages (that have matching txid in the reject data)
3) Wait 16 seconds after first error message received (chosen semirandomly
from trial and error) before processing errors
4) Wait for our txid to be submitted back to us through the mempool, if we
get it notify success and delete all pending error events
5) Signal failure with the given reject code if present (after the 16
seconds have elapsed)
6) If no error or success after 20 seconds, signal timeout failure

This works fairly well in testing. Newer transaction types seem to generate
reject codes 100% of the time (from at least one node when sending to 4
nodes) so this culling / time delay approach is essentially required.

On a related note: One issue is that RBF attempts with too small a fee and
accidental double spends (with enough fee for 1 tx but not a RBF) both
generate the same reject code: not enough fee.

A new reject code for RBF based too small of fee would definitely make for
a better user experience as I’ve seen this exact problem create confusion
for users.

Removing reject codes would make for a much worse user experience. “Your tx
failed and we have no idea why” would be the only message and it would
require waiting for a full timeout.

On Wed, Mar 13, 2019 at 3:16 PM Oscar Guindzberg via bitcoin-dev <
bitcoin-dev@lists•linuxfoundation.org> wrote:

> > I'd like to better understand this, but it would be easier to just
> > read the code than ask a bunch of questions. I tried looking for the
> > handling of reject messages in Android  Bitcoin Wallet and BitcoinJ
> > and didn't really find and handling other than logging exceptions.
> > Would you mind giving me a couple pointers to where in the code
> > they're handled?
>
>
> https://github.com/bitcoinj/bitcoinj/blob/master/core/src/main/java/org/bitcoinj/core/TransactionBroadcast.java#L93-L108
> _______________________________________________
> bitcoin-dev mailing list
> bitcoin-dev@lists•linuxfoundation.org
> https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev
>

[-- Attachment #2: Type: text/html, Size: 3184 bytes --]

  reply	other threads:[~2019-03-13 22:30 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-06  0:53 Marco Falke
2019-03-06  4:00 ` Dustin Dettmer
2019-03-06 16:49 ` Andreas Schildbach
2019-03-07 13:59   ` Sjors Provoost
2019-03-07 17:58     ` Andreas Schildbach
2019-03-08  0:52       ` Gregory Maxwell
2019-03-12 17:08         ` Andreas Schildbach
2019-03-12 22:14           ` Gregory Maxwell
2019-03-13 14:29             ` Andreas Schildbach
2019-03-13 14:41             ` Oscar Guindzberg
2019-03-13 22:30               ` Dustin Dettmer [this message]
2019-03-14  9:46                 ` Aymeric Vitte
2019-03-07 20:52 ` Aymeric Vitte
2019-03-08  0:09 ` Wilmer Paulino
2019-03-08  0:30   ` Eric Voskuil
2019-10-16 16:43 ` John Newbery
2019-10-17 19:38   ` Andreas Schildbach
2019-10-17 20:16     ` Eric Voskuil
2019-10-18 22:45       ` David A. Harding
2019-10-20  5:13         ` Eric Voskuil
2019-10-18 20:53   ` John Newbery
2019-10-21  8:44     ` Andreas Schildbach

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CABLeJxTq-KZz9K=3EgyD5sFpgNzJs_NdOLQdGv=VkGUeLcfteg@mail.gmail.com' \
    --to=dustinpaystaxes@gmail$(echo .)com \
    --cc=andreas@schildbach$(echo .)de \
    --cc=bitcoin-dev@lists$(echo .)linuxfoundation.org \
    --cc=oscar.guindzberg@gmail$(echo .)com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox