Skip to content

Commit 7f83e68

Browse files
committed
[release/1.3.4] eth: fixed homestead tx check
When a block is queried for retrieval we should add a check whether the block falls within the frontier rules. If we'd always use `From` retrieving transaction might fail. This PR temporarily changes everything to `FromFrontier` (safe!). This is a backport of c616391
1 parent 5570b11 commit 7f83e68

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

rpc/api/eth.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -661,7 +661,7 @@ func (self *ethApi) Resend(req *shared.Request) (interface{}, error) {
661661

662662
pending := self.ethereum.TxPool().GetTransactions()
663663
for _, p := range pending {
664-
if pFrom, err := p.From(); err == nil && pFrom == from && p.SigHash() == args.Tx.tx.SigHash() {
664+
if pFrom, err := p.FromFrontier(); err == nil && pFrom == from && p.SigHash() == args.Tx.tx.SigHash() {
665665
self.ethereum.TxPool().RemoveTx(common.HexToHash(args.Tx.Hash))
666666
return self.xeth.Transact(args.Tx.From, args.Tx.To, args.Tx.Nonce, args.Tx.Value, args.GasLimit, args.GasPrice, args.Tx.Data)
667667
}
@@ -688,7 +688,7 @@ func (self *ethApi) PendingTransactions(req *shared.Request) (interface{}, error
688688

689689
var ltxs []*tx
690690
for _, tx := range txs {
691-
if from, _ := tx.From(); accountSet.Has(from) {
691+
if from, _ := tx.FromFrontier(); accountSet.Has(from) {
692692
ltxs = append(ltxs, newTx(tx))
693693
}
694694
}

rpc/api/parsing.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ func NewTransactionRes(tx *types.Transaction) *TransactionRes {
349349
// v.BlockHash =
350350
// v.BlockNumber =
351351
// v.TxIndex =
352-
from, _ := tx.From()
352+
from, _ := tx.FromFrontier()
353353
v.From = newHexData(from)
354354
v.To = newHexData(tx.To())
355355
v.Value = newHexNum(tx.Value())

0 commit comments

Comments
 (0)