Rather than creating a PortfolioEntry for EVERY coin, and throwing 99% of them away, just create the PE for our actual portfolio.

pull/222/head
Simon Roberts 3 years ago
parent 4fe79fc1f5
commit 0b4302f7fc
No known key found for this signature in database
GPG Key ID: 0F30F99E6B771FD4

@ -556,10 +556,11 @@ func (ct *Cointop) GetPortfolioSlice() []*Coin {
return sliced
}
for i := range ct.State.allCoins {
coin := ct.State.allCoins[i]
p, isNew := ct.PortfolioEntry(coin)
if isNew {
for _, p := range ct.State.portfolio.Entries {
coinIfc, _ := ct.State.allCoinsSlugMap.Load(p.Coin)
coin, ok := coinIfc.(*Coin)
if !ok {
log.Errorf("Could not find coin %s", p.Coin)
continue
}
coin.Holdings = p.Holdings

Loading…
Cancel
Save