From 780f747017a1a9f65c781e5f56e81a5afe2006c8 Mon Sep 17 00:00:00 2001 From: Steven Roose Date: Mon, 28 Nov 2016 17:51:07 +0100 Subject: [PATCH] Document tx.To() in case of contract creation txs Solved #3331 --- core/types/transaction.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/core/types/transaction.go b/core/types/transaction.go index 323bfaee60..6447e477d4 100644 --- a/core/types/transaction.go +++ b/core/types/transaction.go @@ -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) 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 { if tx.data.Recipient == nil { return nil