Skip to content

Commit

Permalink
internal/ethapi/api: Chop '0x' in GetQuorumPayload if present
Browse files Browse the repository at this point in the history
  • Loading branch information
patrickmn committed Dec 2, 2016
1 parent 45d697e commit 9d0d329
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions internal/ethapi/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -470,6 +470,12 @@ func (s *PublicBlockChainAPI) GetQuorumPayload(digestHex string) (string, error)
if private.P == nil {
return "", fmt.Errorf("PrivateTransactionManager is not enabled")
}
if len(digestHex) < 3 {
return "", fmt.Errorf("Invalid digest hex")
}
if digestHex[:2] == "0x" {
digestHex = digestHex[2:]
}
b, err := hex.DecodeString(digestHex)
if err != nil {
return "", err
Expand Down

0 comments on commit 9d0d329

Please sign in to comment.