Merge pull request #1541 from bas-vk/issue1518

Improved error handling for NewTransactionFromBytes
This commit is contained in:
Jeffrey Wilcke
2015-08-01 08:47:32 -07:00
2 changed files with 14 additions and 12 deletions

View File

@ -97,15 +97,6 @@ func NewTransaction(nonce uint64, to common.Address, amount, gasLimit, gasPrice
return &Transaction{data: d}
}
func NewTransactionFromBytes(data []byte) *Transaction {
// TODO: remove this function if possible. callers would
// much better off decoding into transaction directly.
// it's not that hard.
tx := new(Transaction)
rlp.DecodeBytes(data, tx)
return tx
}
func (tx *Transaction) EncodeRLP(w io.Writer) error {
return rlp.Encode(w, &tx.data)
}