mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-06-24 07:34:31 +00:00
This commit is contained in:
parent
51b99e40a8
commit
b6b1c4b779
1 changed files with 7 additions and 3 deletions
|
|
@ -1680,7 +1680,7 @@ type RPCTransaction struct {
|
|||
// newRPCTransaction returns a transaction that will serialize to the RPC
|
||||
// representation, with the given location metadata set (if available).
|
||||
func newRPCTransaction(tx *types.Transaction, blockHash common.Hash, blockNumber uint64, index uint64, baseFee *big.Int, config *params.ChainConfig) *RPCTransaction {
|
||||
signer := types.MakeSigner(config, big.NewInt(0).SetUint64(blockNumber))
|
||||
signer := types.MakeSigner(config, new(big.Int).SetUint64(blockNumber))
|
||||
from, _ := types.Sender(signer, tx)
|
||||
v, r, s := tx.RawSignatureValues()
|
||||
result := &RPCTransaction{
|
||||
|
|
@ -1765,11 +1765,15 @@ func effectiveGasPrice(tx *types.Transaction, baseFee *big.Int) *big.Int {
|
|||
|
||||
// newRPCPendingTransaction returns a pending transaction that will serialize to the RPC representation
|
||||
func newRPCPendingTransaction(tx *types.Transaction, current *types.Header, config *params.ChainConfig) *RPCTransaction {
|
||||
var baseFee *big.Int
|
||||
var (
|
||||
baseFee *big.Int
|
||||
blockNumber = uint64(0)
|
||||
)
|
||||
if current != nil {
|
||||
baseFee = eip1559.CalcBaseFee(config, current)
|
||||
blockNumber = current.Number.Uint64()
|
||||
}
|
||||
return newRPCTransaction(tx, common.Hash{}, 0, 0, baseFee, config)
|
||||
return newRPCTransaction(tx, common.Hash{}, blockNumber, 0, baseFee, config)
|
||||
}
|
||||
|
||||
// newRPCTransactionFromBlockIndex returns a transaction that will serialize to the RPC representation.
|
||||
|
|
|
|||
Loading…
Reference in a new issue