mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-17 18:30:45 +00:00
tx from
This commit is contained in:
parent
b0cfa3037f
commit
8eb3182487
1 changed files with 21 additions and 1 deletions
|
|
@ -195,6 +195,19 @@ func (tx *Transaction) To() *common.Address {
|
||||||
return &to
|
return &to
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (tx *Transaction) From() *common.Address {
|
||||||
|
if tx.data.V != nil {
|
||||||
|
signer := deriveSigner(tx.data.V)
|
||||||
|
if f, err := Sender(signer, tx); err != nil {
|
||||||
|
return nil
|
||||||
|
} else {
|
||||||
|
return &f
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Hash hashes the RLP encoding of tx.
|
// Hash hashes the RLP encoding of tx.
|
||||||
// It uniquely identifies the transaction.
|
// It uniquely identifies the transaction.
|
||||||
func (tx *Transaction) Hash() common.Hash {
|
func (tx *Transaction) Hash() common.Hash {
|
||||||
|
|
@ -274,6 +287,13 @@ func (tx *Transaction) IsSpecialTransaction() bool {
|
||||||
return tx.To().String() == common.RandomizeSMC || tx.To().String() == common.BlockSigners
|
return tx.To().String() == common.RandomizeSMC || tx.To().String() == common.BlockSigners
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (tx *Transaction) IsSigningTransaction() bool {
|
||||||
|
if tx.To() == nil {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
return tx.To().String() == common.BlockSigners
|
||||||
|
}
|
||||||
|
|
||||||
func (tx *Transaction) String() string {
|
func (tx *Transaction) String() string {
|
||||||
var from, to string
|
var from, to string
|
||||||
if tx.data.V != nil {
|
if tx.data.V != nil {
|
||||||
|
|
@ -505,4 +525,4 @@ func (m Message) Value() *big.Int { return m.amount }
|
||||||
func (m Message) Gas() uint64 { return m.gasLimit }
|
func (m Message) Gas() uint64 { return m.gasLimit }
|
||||||
func (m Message) Nonce() uint64 { return m.nonce }
|
func (m Message) Nonce() uint64 { return m.nonce }
|
||||||
func (m Message) Data() []byte { return m.data }
|
func (m Message) Data() []byte { return m.data }
|
||||||
func (m Message) CheckNonce() bool { return m.checkNonce }
|
func (m Message) CheckNonce() bool { return m.checkNonce }
|
||||||
Loading…
Reference in a new issue