Skip to content
This repository has been archived by the owner on Oct 4, 2019. It is now read-only.

Commit

Permalink
problem: v,r,s tx values not included in RPC Tx
Browse files Browse the repository at this point in the history
solution: include them

Fixes #684
  • Loading branch information
whilei committed Nov 6, 2018
1 parent f5ccbff commit 8baab09
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions eth/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -915,6 +915,9 @@ type RPCTransaction struct {
Value *rpc.HexNumber `json:"value"`
ReplayProtected bool `json:"replayProtected"`
ChainId *big.Int `json:"chainId,omitempty"`
V *rpc.HexNumber `json:"v"`
R *rpc.HexNumber `json:"r"`
S *rpc.HexNumber `json:"s"`
}

// newRPCPendingTransaction returns a pending transaction that will serialize to the RPC representation
Expand Down Expand Up @@ -956,6 +959,8 @@ func newRPCTransactionFromBlockIndex(b *types.Block, txIndex int) (*RPCTransacti
}
from, _ := types.Sender(signer, tx)

v, r, s := tx.RawSignatureValues()

return &RPCTransaction{
BlockHash: b.Hash(),
BlockNumber: rpc.NewHexNumber(b.Number()),
Expand All @@ -970,6 +975,9 @@ func newRPCTransactionFromBlockIndex(b *types.Block, txIndex int) (*RPCTransacti
Value: rpc.NewHexNumber(tx.Value()),
ReplayProtected: protected,
ChainId: chainId,
V: rpc.NewHexNumber(v),
R: rpc.NewHexNumber(r),
S: rpc.NewHexNumber(s),
}, nil
}

Expand Down

0 comments on commit 8baab09

Please sign in to comment.