diff --git a/go.mod b/go.mod index 1bed2bf..4d080ea 100644 --- a/go.mod +++ b/go.mod @@ -9,7 +9,7 @@ require ( github.com/btcsuite/btcd v0.20.1-beta github.com/btcsuite/btcutil v1.0.1 github.com/ethereum/go-ethereum v1.9.15 - github.com/fioprotocol/fio-go v1.0.3-0.20201222151005-9e1df6dd6005 + github.com/fioprotocol/fio-go v1.0.3-0.20210108173809-98ac48363ba8 github.com/skip2/go-qrcode v0.0.0-20191027152451-9434209cb086 golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9 golang.org/x/text v0.3.3 diff --git a/go.sum b/go.sum index 90dd969..bea5708 100644 --- a/go.sum +++ b/go.sum @@ -72,6 +72,8 @@ github.com/fioprotocol/fio-go v1.0.3-0.20201220224546-01e10838c33f h1:z7USAVPeG0 github.com/fioprotocol/fio-go v1.0.3-0.20201220224546-01e10838c33f/go.mod h1:cX96BK9Y8fQPJP2GXGQvCFovHJ35lw7ICUUUAzqnH40= github.com/fioprotocol/fio-go v1.0.3-0.20201222151005-9e1df6dd6005 h1:j65XCEjg+xFKKcsngbXRECbXN2UEZGqGrO7tq3+u0qI= github.com/fioprotocol/fio-go v1.0.3-0.20201222151005-9e1df6dd6005/go.mod h1:cX96BK9Y8fQPJP2GXGQvCFovHJ35lw7ICUUUAzqnH40= +github.com/fioprotocol/fio-go v1.0.3-0.20210108173809-98ac48363ba8 h1:xrIGis41tO44VljhbH87aPHVIra5q/d/w5f56Ou4FW8= +github.com/fioprotocol/fio-go v1.0.3-0.20210108173809-98ac48363ba8/go.mod h1:cX96BK9Y8fQPJP2GXGQvCFovHJ35lw7ICUUUAzqnH40= github.com/fjl/memsize v0.0.0-20180418122429-ca190fb6ffbc/go.mod h1:VvhXpOYNQvB+uIk2RvXzuaQtkQJzzIx6lSBe1xv7hi0= github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= diff --git a/vote.go b/vote.go index 8a48765..4eed2d7 100644 --- a/vote.go +++ b/vote.go @@ -112,10 +112,22 @@ var bpInfoCache = make(map[string]*bpInfo) func getBpInfo(actor string, api *fio.API) ([]bpInfo, error) { bpi := make([]bpInfo, 0) - prods, err := api.GetFioProducers() + p, err := api.GetFioProducers() if err != nil { return bpi, err } + + prods := &fio.Producers{ + Producers: make([]fio.Producer, 0), + } + // little hack for testnet to cleanup crap from various test scripts: + for i := range p.Producers { + if strings.Contains(p.Producers[i].Url, "dapix.io") { + continue + } + prods.Producers = append(prods.Producers, p.Producers[i]) + } + curVotes := strings.Split(GetCurrentVotes(actor, api), ",") for i := range curVotes { curVotes[i] = strings.TrimSpace(curVotes[i])