You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It's the sign method, it doesn't sign the second input because it uses the same key.
You can sign it like this to workaround this issue: t.sign(private, tid=0) t.sign(private, tid=1)
Hi everyone!
I'm trying to make a Transaction from an address that has several utxos. If I build an array of Inputs, and then make the Transaction it fails:
############# Balance=1BTC / utxo1[value]=0.5BTC / utxo2[value]=0.5BTC #############
inp1 = Input(prev_hash='xxxxx',output_index=0,keys=pubkey.public(), network='testnet') #from utxo1
inp2 = Input(prev_hash='yyyy',output_index=0,keys=pubkey.public(), network='testnet') #from utxo2
out = Output(100000000, address=addr_to, network='testnet')
t = Transaction(inputs=[inp1,inp2],outputs=[out], network='testnet')
t.sign(private)
t.verify() # False
But if I try to make a Transaction only using the information from one utxo, it's completed ok:
############# Balance=1BTC / utxo1[value]=0.5BTC / utxo2[value]=0.5BTC #############
inp1 = Input(prev_hash='xxxxx',output_index=0,keys=pubkey.public(), network='testnet') #from utxo1
out = Output(50000000, address=addr_to, network='testnet')
t = Transaction(inputs=[inp1],outputs=[out], network='testnet')
t.sign(private)
t.verify() # True
Is there any way to build a Transaction from several utxo's?
The text was updated successfully, but these errors were encountered: