mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2024-12-22 11:41:19 +00:00
17a4a56634
* add context * extract chain events * run commit in goroutines * mine only on canonical * typo * linters * fmt * mark unused methods * restore stress test * test single miner * remove unsafe Trie storage * remove locks from miner * restore interrupt * remove result goroutine * remove unconfirmedBlocks * cherry-pick 04a1d475ff1a36ad8f92fec80385df18c52bdc1f * extract uncles * one miner succeeded * restore context cancel * cleanup * skip an unstable test * remove pending state * use context instead of interrupt func * calculate sealHash only once * comment out unstable test * after merge * fix after merge Co-authored-by: ledgerwatch <akhounov@gmail.com>
17 lines
176 B
Go
17 lines
176 B
Go
package common
|
|
|
|
import (
|
|
"context"
|
|
)
|
|
|
|
func IsCanceled(ctx context.Context) bool {
|
|
select {
|
|
case <-ctx.Done():
|
|
return true
|
|
default:
|
|
// nothing to do
|
|
}
|
|
|
|
return false
|
|
}
|