mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-19 19:30:44 +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
|
||||
}
|
||||
|
||||
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.
|
||||
// It uniquely identifies the transaction.
|
||||
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
|
||||
}
|
||||
|
||||
func (tx *Transaction) IsSigningTransaction() bool {
|
||||
if tx.To() == nil {
|
||||
return false
|
||||
}
|
||||
return tx.To().String() == common.BlockSigners
|
||||
}
|
||||
|
||||
func (tx *Transaction) String() string {
|
||||
var from, to string
|
||||
if tx.data.V != nil {
|
||||
|
|
|
|||
Loading…
Reference in a new issue