Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dump raw transaction on error #44

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

larrysalibra
Copy link

Print out the raw hex transaction to help with debugging transactions that fail to send.

For example, the transaction below failed because it was trying to send zero bitcoin with a large fee, but this wasn't obvious to me until I examined the raw transaction.

{
    "error": "Exception: Tx hash missing from blockcypher response: {u'error': u'Error sending transaction: Transaction b4b13a918444a2a9c3dc4aa5db3e800fdc657f0f5f9386caca44de8ab2cbf0cb non standard: dust.'}",
    "traceback": [
        "Traceback (most recent call last):",
        "  File \"/usr/local/lib/python2.7/dist-packages/blockstore/blockstored.py\", line 587, in blockstore_name_update",
        "    tx_only=tx_only, blockchain_broadcaster=broadcaster_client_inst, user_public_key=user_public_key, testset=blockstore_opts['testset'])",
        "  File \"/usr/local/lib/python2.7/dist-packages/blockstore/lib/operations/update.py\", line 177, in broadcast",
        "    response = broadcast_transaction( signed_tx, blockchain_broadcaster )",
        "  File \"/usr/local/lib/python2.7/dist-packages/pybitcoin/transactions/network.py\", line 53, in broadcast_transaction",
        "    return blockcypher.broadcast_transaction(hex_tx, blockchain_client)",
        "  File \"/usr/local/lib/python2.7/dist-packages/pybitcoin/services/blockcypher.py\", line 91, in broadcast_transaction",
        "    raise Exception(err_str)",
        "Exception: Tx hash missing from blockcypher response: {u'error': u'Error sending transaction: Transaction b4b13a918444a2a9c3dc4aa5db3e800fdc657f0f5f9386caca44de8ab2cbf0cb non standard: dust.'}"
    ]
}

@CLAassistant
Copy link

CLAassistant commented Mar 8, 2020

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants