Commit 1b7f4888 authored by duanjinfei's avatar duanjinfei

broadcast tx arr goroutine

parent f6befab1
...@@ -36,20 +36,22 @@ func startTest() { ...@@ -36,20 +36,22 @@ func startTest() {
log.Errorf("Bath Send Tran error: %s", err) log.Errorf("Bath Send Tran error: %s", err)
return return
} }
go func() { if err := transaction.InitBroadcastTxGoroutine(cfg); err != nil {
if err := transaction.InitBroadcastTxGoroutine(cfg); err != nil { log.Errorf("Init broadcast tx goroutine error: %s", err)
log.Errorf("Init broadcast tx goroutine error: %s", err) }
} for i := 0; i < 2; i++ {
for { go func() {
select { for {
case arr := <-tranArrChan: select {
log.Info("-----into tranArrChan-----") case arr := <-tranArrChan:
if err := transaction.BroadcastTxArr(arr, cfg); err != nil { log.Info("-----into tranArrChan-----")
log.Errorf("Bath Send Tran error: %s", err) if err := transaction.BroadcastTxArr(arr, cfg); err != nil {
log.Errorf("Bath Send Tran error: %s", err)
}
} }
} }
} }()
}() }
for { for {
log.Info("----------------------------------start") log.Info("----------------------------------start")
//arr := transaction.SignedTxArr(syncMap, SendTxAccountArr, cfg) //arr := transaction.SignedTxArr(syncMap, SendTxAccountArr, cfg)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment