blockchain_go
blockchain_go copied to clipboard
used UTXO_set index directly to set TxInput.Vout was a bug.
acc, validOutputs := UTXOSet.FindSpendableOutputs(pubKeyHash, amount)
if acc < amount {
log.Panic("ERROR: Not enough funds")
}
// Build a list of inputs
for txid, outs := range validOutputs {
txID, err := hex.DecodeString(txid)
if err != nil {
log.Panic(err)
}
for _, out := range outs {
input := TXInput{txID, out, nil, wallet.PublicKey}
inputs = append(inputs, input)
}
}
used UTXO_set index directly to set TxInput.Vout was a bug. because exist TxOutput has been used, the TxOutput index is different from UTXO_set index
I meet the same problem. By reference to your pull now the problem has been solved. Thank you very much.