Document tx.To() in case of contract creation txs

Solved #3331
This commit is contained in:
Steven Roose 2016-11-28 17:51:07 +01:00
parent 2c802399c3
commit 780f747017

View file

@ -233,6 +233,8 @@ func (tx *Transaction) Value() *big.Int { return new(big.Int).Set(tx.data.Amo
func (tx *Transaction) Nonce() uint64 { return tx.data.AccountNonce } func (tx *Transaction) Nonce() uint64 { return tx.data.AccountNonce }
func (tx *Transaction) CheckNonce() bool { return true } func (tx *Transaction) CheckNonce() bool { return true }
// Get the recipient address of this transaction.
// It returns nil if the transaction is a contract creation transaction.
func (tx *Transaction) To() *common.Address { func (tx *Transaction) To() *common.Address {
if tx.data.Recipient == nil { if tx.data.Recipient == nil {
return nil return nil