From 09f76e891967a146363ccbd8fe8ccf53656c270e Mon Sep 17 00:00:00 2001 From: Nikhil Saraf <1028334+nikhilsaraf@users.noreply.github.com> Date: Tue, 19 Mar 2019 14:56:49 -0700 Subject: [PATCH] fix mirror strategy not working without offsetTrades flag, fixes #127 --- plugins/mirrorStrategy.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/plugins/mirrorStrategy.go b/plugins/mirrorStrategy.go index c8d49cecd..703f895c4 100644 --- a/plugins/mirrorStrategy.go +++ b/plugins/mirrorStrategy.go @@ -143,7 +143,10 @@ func (s *mirrorStrategy) PruneExistingOffers(buyingAOffers []horizon.Offer, sell // PreUpdate changes the strategy's state in prepration for the update func (s *mirrorStrategy) PreUpdate(maxAssetA float64, maxAssetB float64, trustA float64, trustB float64) error { - return s.recordBalances() + if s.offsetTrades { + return s.recordBalances() + } + return nil } func (s *mirrorStrategy) recordBalances() error {