Skip to content

Commit

Permalink
Merge pull request #10129 from vegaprotocol/10126-nil-ptr
Browse files Browse the repository at this point in the history
fix: nil pointer panic
  • Loading branch information
EVODelavega authored Nov 17, 2023
2 parents 0eb157d + 9242099 commit f53468c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
- [10103](https://github.com/vegaprotocol/vega/issues/10103) - List ledgers `API` returns bad error when filtering by transfer type only.
- [10120](https://github.com/vegaprotocol/vega/issues/10120) - Assure theoretical and actual funding payment calculations are consistent.
- [10121](https://github.com/vegaprotocol/vega/issues/10121) - Assure `EstimatePosition` API works correctly with sparse perps data
- [10126](https://github.com/vegaprotocol/vega/issues/10126) - Account for invalid stop orders in batch, charge default gas.

## 0.73.0

Expand Down
6 changes: 4 additions & 2 deletions core/processor/gastimator.go
Original file line number Diff line number Diff line change
Expand Up @@ -209,9 +209,11 @@ func (g *Gastimator) batchGastimate(batch *commandspb.BatchMarketInstructions) u
factor = 1.0
}
var marketId string
if os.FallsBelow != nil {
// if both are nil, marketId will be empty string, yielding default gas
// the order is invalid, but validation is applied later.
if os.FallsBelow != nil && os.FallsBelow.OrderSubmission != nil {
marketId = os.FallsBelow.OrderSubmission.MarketId
} else {
} else if os.RisesAbove != nil && os.RisesAbove.OrderSubmission != nil {
marketId = os.RisesAbove.OrderSubmission.MarketId
}
orderGas := g.orderGastimate(marketId)
Expand Down

0 comments on commit f53468c

Please sign in to comment.