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

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

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

Conversation

benni82
Copy link

@benni82 benni82 commented Nov 26, 2018


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

@vectorsss
Copy link

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

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