kopia lustrzana https://github.com/bugout-dev/moonstream
Code structure organization
rodzic
838c75ae29
commit
d55209df42
|
@ -73,19 +73,6 @@ func show(blockNumbers []uint64) error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO(kompotkot): Find way to remove Number
|
|
||||||
type Result struct {
|
|
||||||
ErrorOutput string
|
|
||||||
ErrorSource string
|
|
||||||
Number uint64
|
|
||||||
Output string
|
|
||||||
}
|
|
||||||
|
|
||||||
type Job struct {
|
|
||||||
BlockNumber uint64
|
|
||||||
Results chan<- Result
|
|
||||||
}
|
|
||||||
|
|
||||||
// Run verification flow of blockchain with database data
|
// Run verification flow of blockchain with database data
|
||||||
func verify(blockchain string, blockNumbers []uint64, workers int) error {
|
func verify(blockchain string, blockNumbers []uint64, workers int) error {
|
||||||
jobsCh := make(chan Job, workers)
|
jobsCh := make(chan Job, workers)
|
||||||
|
|
|
@ -52,3 +52,17 @@ type CorruptBlock struct {
|
||||||
type CorruptBlocks struct {
|
type CorruptBlocks struct {
|
||||||
Blocks []CorruptBlock `json:"blocks"`
|
Blocks []CorruptBlock `json:"blocks"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Concurrency jobs structure
|
||||||
|
type Job struct {
|
||||||
|
BlockNumber uint64
|
||||||
|
Results chan<- Result
|
||||||
|
}
|
||||||
|
|
||||||
|
// TODO(kompotkot): Find way to remove Number
|
||||||
|
type Result struct {
|
||||||
|
ErrorOutput string
|
||||||
|
ErrorSource string
|
||||||
|
Number uint64
|
||||||
|
Output string
|
||||||
|
}
|
||||||
|
|
Ładowanie…
Reference in New Issue