Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
pkieltyka committed Oct 23, 2024
1 parent fb5c6c7 commit 206f342
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions ethrpc/unmarshal.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ type rpcBlock struct {
}

type rpcTransaction struct {
tx *types.Transaction
txVRSValid bool
tx *types.Transaction
txVRSInvalid bool
txExtraInfo
}

Expand All @@ -44,11 +44,9 @@ func (tx *rpcTransaction) UnmarshalJSON(msg []byte) error {
return err
}

// we set internal flag to check if txn has valid VRS signature
// we set internal flag to check if txn has invalid VRS signature
if err == types.ErrInvalidSig {
tx.txVRSValid = false
} else {
tx.txVRSValid = true
tx.txVRSInvalid = true
}
}

Expand Down Expand Up @@ -104,7 +102,7 @@ func IntoBlock(raw json.RawMessage, ret **types.Block, strictness StrictnessLeve
setSenderFromServer(tx.tx, *tx.From, body.Hash)
}

if (strictness == StrictnessLevel_Default || strictness == StrictnessLevel_Strict) && !tx.txVRSValid {
if (strictness == StrictnessLevel_Default || strictness == StrictnessLevel_Strict) && tx.txVRSInvalid {
return fmt.Errorf("invalid transaction v, r, s")
}

Expand Down

0 comments on commit 206f342

Please sign in to comment.