Skip to content

Commit 9d0d329

Browse files
committed
internal/ethapi/api: Chop '0x' in GetQuorumPayload if present
1 parent 45d697e commit 9d0d329

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

internal/ethapi/api.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -470,6 +470,12 @@ func (s *PublicBlockChainAPI) GetQuorumPayload(digestHex string) (string, error)
470470
if private.P == nil {
471471
return "", fmt.Errorf("PrivateTransactionManager is not enabled")
472472
}
473+
if len(digestHex) < 3 {
474+
return "", fmt.Errorf("Invalid digest hex")
475+
}
476+
if digestHex[:2] == "0x" {
477+
digestHex = digestHex[2:]
478+
}
473479
b, err := hex.DecodeString(digestHex)
474480
if err != nil {
475481
return "", err

0 commit comments

Comments
 (0)