add hash check in transaction unmarshalling

This commit is contained in:
umi 2024-06-22 18:30:00 +08:00
parent a71f6f91fd
commit 3380423825

View file

@ -416,6 +416,9 @@ func (tx *Transaction) UnmarshalJSON(input []byte) error {
// Now set the inner transaction.
tx.setDecoded(inner, 0)
// TODO: check hash here?
if dec.Hash != tx.Hash() {
return errors.New("hash mismatch")
}
return nil
}