all: use rlp.DecodeBytes instead of rlp.Decode where possible (#27994)

This commit is contained in:
Felix Lange
2023-08-24 11:47:42 +03:00
committed by GitHub
parent 60ec41ce73
commit 9b46986edc
9 changed files with 13 additions and 17 deletions
+2
View File
@@ -238,6 +238,8 @@ func Decode(input []byte) (Packet, Pubkey, []byte, error) {
default:
return nil, fromKey, hash, fmt.Errorf("unknown type: %d", ptype)
}
// Here we use NewStream to allow for additional data after the first
// RLP object (forward-compatibility).
s := rlp.NewStream(bytes.NewReader(sigdata[1:]), 0)
err = s.Decode(req)
return req, fromKey, hash, err