wallet: make it possible to disable transaction broadcast #5951

pull laanwj wants to merge 2 commits into bitcoin:master from laanwj:2015_03_wallet_disable_tx_broadcast changing 4 files +64 −7
  1. laanwj commented at 10:16 am on March 27, 2015: member

    This is an advanced feature which will disable any kind of automatic transaction broadcasting in the wallet. It gives the user full control of how their transactions are sent.

    They can broadcast a new transaction through some other mechanism, or send it to the recipient directly, after getting the transaction hex through gettransaction. This can be used to do #4564.

    It is an important step toward addressing #3828.

    This just adds the option -walletbroadcast=<0,1>. Right now with -walletbroadcast=0 new transactions will get the status

    0Status: conflicted, has not been successfully broadcast yet
    

    …which is a tad strange. This is just a visual issue, though, and goes away when the transaction is received through the network.

    Edit: discussing with @gmaxwell on IRC we thought of a way to avoid this without arcane changes to conflict handling: keep track of the seen-the-network status of transactions internally. If the transaction was not seen on the network, either through our own broadcasting or from a third-party, show it with a different status

  2. laanwj added the label Wallet on Mar 27, 2015
  3. laanwj force-pushed on Mar 27, 2015
  4. laanwj force-pushed on Mar 27, 2015
  5. laanwj force-pushed on Mar 27, 2015
  6. laanwj force-pushed on Mar 27, 2015
  7. dgenr8 commented at 4:45 pm on March 28, 2015: contributor
    +1 to users not seeing the term “conflicted” when such is not the case. I don’t know what else was considered but tracking a persistent seen-the-network status and showing “Not shared” or similar seems a good way to do this.
  8. gmaxwell commented at 0:42 am on March 29, 2015: contributor
    @dgenr8 I think it was never the plan to leave it that way forever… In any case, the more complete and correct way to handle that is to change the conflict logic from checking if the txn is in the mempool already to checking if the it would be accepted into the mempool if it were tried; but thats a fair bit of work for what is otherwise a small feature, so it’s not great to have to do it first.
  9. laanwj commented at 12:12 pm on March 30, 2015: member
    This functionality is already useful, temporarily showing the transaction as conflicted is arguably a small issue. Not saying it doesn’t deserve to be fixed, but it could be done later.
  10. gmaxwell commented at 6:13 pm on March 30, 2015: contributor
    @laanwj getrawtransaction needs to check the wallet. :) (otherwise there is no way to getrawtransaction on a transaction you just created via the wallet)
  11. jonasschnelli commented at 8:04 am on March 31, 2015: contributor
    utACK. I think a rpc test who covers this feature would be nice. I’ll write once during this or next week.
  12. gmaxwell commented at 11:49 am on March 31, 2015: contributor
    @jonasschnelli it doesn’t actually work right now for the reason I described.
  13. laanwj commented at 7:08 am on April 1, 2015: member

    It does actually work right now. I’ve tested it.

    As said in the opening post you can get the transaction hex using gettransaction. Using getrawtransaction won’t work, as it doesn’t (and should not!) query the wallet.

  14. gmaxwell commented at 7:20 am on April 1, 2015: contributor
    ::facepalm:: I had completely forgotten about the existence of gettransaction and on account read that as getrawtransaction.
  15. gmaxwell commented at 7:24 am on April 1, 2015: contributor
    (tested) ACK.
  16. jonasschnelli commented at 10:02 am on April 1, 2015: contributor
  17. wallet: make it possible to disable transaction broadcast
    This is an advanced feature which will disable any kind of automatic
    transaction broadcasting in the wallet. This gives the user full control
    of how the transaction is sent.
    
    For example they can broadcast new transactions through some other
    mechanism themselves, after getting the transaction hex through `gettransaction`.
    
    This just adds the option `-walletbroadcast=<0,1>`. Right now these
    transactions will get the status
    
        Status: conflicted, has not been successfully broadcast yet
    
    They shouldn't be shown as conflicted at all (`walletconflicts` is empty). This status
    will go away when the transaction is received through the network.
    6f252627b2
  18. add -walletbroadcast=0 rpc test 77650cc9f4
  19. laanwj force-pushed on Apr 1, 2015
  20. laanwj commented at 11:05 am on April 1, 2015: member
    rebased and squashed to pull in @jonasschnelli ’s RPC test, thanks!
  21. jgarzik commented at 12:13 pm on April 1, 2015: contributor
    ut ACK
  22. laanwj merged this on Apr 8, 2015
  23. laanwj closed this on Apr 8, 2015

  24. laanwj referenced this in commit 7efc9cf672 on Apr 8, 2015
  25. laanwj added the label Privacy on Aug 18, 2015
  26. DrahtBot locked this on Sep 8, 2021

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: 2024-07-01 10:13 UTC

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