aboutsummaryrefslogtreecommitdiffstats
path: root/ethchain/transaction.go
diff options
context:
space:
mode:
Diffstat (limited to 'ethchain/transaction.go')
-rw-r--r--ethchain/transaction.go12
1 files changed, 10 insertions, 2 deletions
diff --git a/ethchain/transaction.go b/ethchain/transaction.go
index 25d63879b..2c5615f99 100644
--- a/ethchain/transaction.go
+++ b/ethchain/transaction.go
@@ -57,10 +57,15 @@ func (tx *Transaction) Hash() []byte {
return ethutil.Sha3Bin(ethutil.NewValue(data).Encode())
}
-func (tx *Transaction) IsContract() bool {
+func (tx *Transaction) CreatesContract() bool {
return tx.contractCreation
}
+/* Depricated */
+func (tx *Transaction) IsContract() bool {
+ return tx.CreatesContract()
+}
+
func (tx *Transaction) CreationAddress() []byte {
return ethutil.Sha3Bin(ethutil.NewValue([]interface{}{tx.Sender(), tx.Nonce}).Encode())[12:]
}
@@ -139,6 +144,9 @@ func (tx *Transaction) RlpValueDecode(decoder *ethutil.Value) {
tx.v = byte(decoder.Get(6).Uint())
tx.r = decoder.Get(7).Bytes()
tx.s = decoder.Get(8).Bytes()
+ if len(tx.Recipient) == 0 {
+ tx.contractCreation = true
+ }
/*
// If the list is of length 10 it's a contract creation tx
@@ -173,7 +181,7 @@ func (tx *Transaction) String() string {
S: 0x%x
`,
tx.Hash(),
- len(tx.Recipient) == 1,
+ len(tx.Recipient) == 0,
tx.Sender(),
tx.Recipient,
tx.Nonce,