mirror of
https://github.com/0glabs/0g-chain.git
synced 2024-11-14 03:55:19 +00:00
2d7f5c4080
* update sidebar order * update event backticks * fix broken links * fix spelling
23 lines
443 B
Markdown
23 lines
443 B
Markdown
<!--
|
|
order: 6
|
|
-->
|
|
|
|
# Begin Block
|
|
|
|
At the start of each block, auctions that have reached `EndTime` are closed. The logic to close auctions is as follows:
|
|
|
|
```go
|
|
var expiredAuctions []uint64
|
|
k.IterateAuctionsByTime(ctx, ctx.BlockTime(), func(id uint64) bool {
|
|
expiredAuctions = append(expiredAuctions, id)
|
|
return false
|
|
})
|
|
|
|
for _, id := range expiredAuctions {
|
|
err := k.CloseAuction(ctx, id)
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
}
|
|
```
|