Report missing inputs in sendrawtransaction #5418

pull sipa wants to merge 2 commits into bitcoin:master from sipa:logmissing changing 3 files +78 −3
  1. sipa commented at 1:14 PM on December 3, 2014: member

    No description provided.

  2. sipa force-pushed on Dec 3, 2014
  3. gavinandresen commented at 2:40 PM on December 3, 2014: contributor

    utACK

  4. gmaxwell commented at 5:02 PM on December 3, 2014: contributor

    ACK. I note that transactions with present inputs but missing signatures return -25 and message "", maybe that case should be covered to (I'm not sure what in particular inspired this particular improvement).

  5. sipa commented at 5:14 PM on December 3, 2014: member

    Missing signatures? That should result in script failure, which should be reported with #5394.

  6. gmaxwell commented at 5:32 PM on December 3, 2014: contributor

    Well kinda, it logs non-standard transaction inputs. :) it's okay, I didn't mean to start a tangent. I just wasn't sure what motivated this.

  7. sipa commented at 5:33 PM on December 3, 2014: member

    What motivated this: doing a sendrawtransaction that reported a -25 "" status, which is pretty unhelpful. Turns out, there were just missing inputs.

  8. laanwj commented at 11:56 AM on December 4, 2014: member

    utACK commithash 178e796a38c6b04cf7f6ee15e5b5c1f94248abd0 (signature)

  9. laanwj added the label RPC on Dec 4, 2014
  10. in src/rpcrawtransaction.cpp:None in 178e796a38 outdated
     747 |              if(state.IsInvalid())
     748 |                  throw JSONRPCError(RPC_TRANSACTION_REJECTED, strprintf("%i: %s", state.GetRejectCode(), state.GetRejectReason()));
     749 | -            else
     750 | +            else {
     751 | +                if (fMissingInputs) {
     752 | +                    throw JSONRPCError(RPC_TRANSACTION_REJECTED, "Missing inputs");
    


    luke-jr commented at 12:55 PM on December 5, 2014:

    Shouldn't this be a RPC_TRANSACTION_ERROR?


    sipa commented at 2:47 PM on December 8, 2014:

    No opinion.


    laanwj commented at 3:41 PM on December 8, 2014:

    For RPC_TRANSACTION_REJECTED I'd prefer to keep to the "%i: %s" % (code,reason) convention used above. So if it doesn't fit within that, RPC_TRANSACTION_ERROR may be better.


    sipa commented at 10:38 PM on December 9, 2014:

    The current RPC_TRANSACTION_ERROR is for cases where there is no "IsInvalid", so that should really just be system errors.


    laanwj commented at 6:53 AM on December 10, 2014:

    If you keep using RPC_TRANSACTION_REJECTED, can you add a reject code, to keep the format?


    sipa commented at 2:17 PM on April 28, 2015:

    Changed to RPC_TRANSACTION_ERROR.

  11. jonasschnelli referenced this in commit 4f0743db5d on Dec 29, 2014
  12. jonasschnelli commented at 7:18 PM on December 29, 2014: contributor

    Tested. ACK. You might pull in my just written RPC test: https://github.com/jonasschnelli/bitcoin/commit/4f0743db5dafa86af21525f73578f948edddef6f

  13. EagleTM commented at 3:58 PM on February 27, 2015: none

    I've applied this patch to 0.10.0 for debugging purposes and it works well and detects lots of {u'message': u'Missing inputs', u'code': -26} on a public electrum server. I believe these were reported as code -25 before applying the patch, because this is the only error code I can find in logs which does not have a message. Moreover "Missing inputs" accounts for 70% of u'code': -26 messages and the overall rate has gone up, while code -25 decreased.

  14. sipa force-pushed on Mar 1, 2015
  15. sipa referenced this in commit ca96f2c104 on Mar 1, 2015
  16. sipa commented at 11:02 AM on March 1, 2015: member

    Rebased and cherry-picked @jonasschnelli's RPC test.

  17. laanwj commented at 8:10 AM on April 28, 2015: member

    utACK, needs rebase though

  18. Report missing inputs in sendrawtransaction de8e801d3f
  19. sipa force-pushed on Apr 28, 2015
  20. sipa referenced this in commit d58a6c58d8 on Apr 28, 2015
  21. sipa commented at 2:17 PM on April 28, 2015: member

    Rebased and nit addressed.

  22. laanwj commented at 1:02 PM on May 1, 2015: member

    Fails travis, the test needs to be updated to use generate:

    Running testscript rawtransactions.py...
    Initializing test directory /tmp/testtgQ972
    JSONRPC error: Use the generate method instead of setgenerate on this network
    File "/home/travis/build/bitcoin/bitcoin/bitcoin-i686-pc-linux-gnu/qa/rpc-tests/test_framework.py", line 119, in main
    self.run_test()
    File "/home/travis/build/bitcoin/bitcoin/bitcoin-i686-pc-linux-gnu/qa/rpc-tests/rawtransactions.py", line 42, in run_test
    self.nodes[2].setgenerate(True, 1)
    File "/home/travis/build/bitcoin/bitcoin/bitcoin-i686-pc-linux-gnu/qa/rpc-tests/python-bitcoinrpc/bitcoinrpc/authproxy.py", line 126, in __call__
    raise JSONRPCException(response['error'])
    Stopping nodes
    Cleaning up
    
  23. jonasschnelli referenced this in commit 70eccdf6e2 on May 1, 2015
  24. RPC test for "#5418 Report missing inputs in sendrawtransaction" bba2216fc1
  25. sipa force-pushed on May 1, 2015
  26. sipa commented at 1:34 PM on May 1, 2015: member

    Updated.

  27. laanwj merged this on May 4, 2015
  28. laanwj closed this on May 4, 2015

  29. laanwj referenced this in commit 16341cc15c on May 4, 2015
  30. promag referenced this in commit 02aae2f614 on May 5, 2015
  31. land-pack commented at 6:07 AM on July 23, 2018: none

    It's fixed?

  32. MarcoFalke 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: 2026-04-13 15:15 UTC

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