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

serialize_sign_and_broadcast only signs the first input #40

Open
peacekeeper opened this issue Oct 4, 2015 · 1 comment
Open

serialize_sign_and_broadcast only signs the first input #40

peacekeeper opened this issue Oct 4, 2015 · 1 comment

Comments

@peacekeeper
Copy link

in serialize_sign_and_broadcast() in transactions/network.py, sign_transaction() is only called on the first input (index 0):

def serialize_sign_and_broadcast(inputs, outputs, private_key,
                                 blockchain_client=BlockchainInfoClient()):
    # extract the private key object
    private_key_obj = get_private_key_obj(private_key)
    # serialize the transaction
    unsigned_tx = serialize_transaction(inputs, outputs)
    # sign the unsigned transaction with the private key
    signed_tx = sign_transaction(unsigned_tx, 0, private_key_obj.to_hex())
    # dispatch the signed transction to the network
    response = broadcast_transaction(signed_tx, blockchain_client)
    # return the response
    return response

therefore transactions that require multiple inputs become invalid

@jcnelson
Copy link
Member

jcnelson commented Oct 4, 2015

Hi @peacekeeper,

This problem has been fixed in my branch (https://github.com/blockstack/pybitcoin/tree/jcnelson-master).

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

No branches or pull requests

2 participants