blockchain_go icon indicating copy to clipboard operation
blockchain_go copied to clipboard

used UTXO_set index directly to set TxInput.Vout was a bug.

Open benni82 opened this issue 7 years ago • 1 comments


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

benni82 avatar Nov 26 '18 08:11 benni82

I meet the same problem. By reference to your pull now the problem has been solved. Thank you very much.

vectorsss avatar Apr 28 '19 14:04 vectorsss