mirror of https://github.com/poanetwork/quorum.git
SignTransaction APIs: Set tx as private before signing (#864)
This commit is contained in:
parent
a15ccedbc0
commit
1dcee8518b
|
@ -367,6 +367,10 @@ func (s *PrivateAccountAPI) signTransaction(ctx context.Context, args *SendTxArg
|
|||
// Assemble the transaction and sign with the wallet
|
||||
tx := args.toTransaction()
|
||||
|
||||
if args.PrivateFor != nil {
|
||||
tx.SetPrivate()
|
||||
}
|
||||
|
||||
var chainID *big.Int
|
||||
if config := s.b.ChainConfig(); config.IsEIP155(s.b.CurrentBlock().Number()) {
|
||||
chainID = config.ChainID
|
||||
|
@ -1518,13 +1522,17 @@ func (s *PublicTransactionPoolAPI) SignTransaction(ctx context.Context, args Sen
|
|||
if err := args.setDefaults(ctx, s.b); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
tx, err := s.sign(args.From, args.toTransaction())
|
||||
|
||||
toSign := args.toTransaction()
|
||||
|
||||
if args.PrivateFor != nil {
|
||||
toSign.SetPrivate()
|
||||
}
|
||||
|
||||
tx, err := s.sign(args.From, toSign)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if args.PrivateFor != nil {
|
||||
tx.SetPrivate()
|
||||
}
|
||||
data, err := rlp.EncodeToBytes(tx)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
|
Loading…
Reference in New Issue