Skip to content

Commit

Permalink
gateway: Actually guard against invalid OutlineTransactions
Browse files Browse the repository at this point in the history
  • Loading branch information
lukechampine committed Jan 2, 2024
1 parent 38ae2e7 commit 01d5148
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions gateway/encoding.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,13 +102,13 @@ func (ot *OutlineTransaction) decodeFrom(d *types.Decoder) {
ot.Transaction = new(types.Transaction)
ot.Transaction.DecodeFrom(d)
// FullHash chokes on invalid input
if d.Err() != nil {
if d.Err() == nil {
ot.Hash = ot.Transaction.FullHash()
}
case 1:
ot.V2Transaction = new(types.V2Transaction)
ot.V2Transaction.DecodeFrom(d)
if d.Err() != nil {
if d.Err() == nil {
ot.Hash = ot.V2Transaction.FullHash()
}
case 2:
Expand Down

0 comments on commit 01d5148

Please sign in to comment.