Exemple #1
0
func (w *SCWallet) UpdateInput(trans fct.ITransaction, index int, address fct.IAddress, amount uint64) error {

	we, adr, err := w.getWalletEntry([]byte(fct.W_RCD_ADDRESS_HASH), address)
	if err != nil {
		return err
	}

	in, err := trans.GetInput(index)
	if err != nil {
		return err
	}

	trans.GetRCDs()[index] = we.GetRCD() // The RCD must match the (possibly) new input

	in.SetAddress(adr)
	in.SetAmount(amount)

	return nil
}