Skip to content

Commit 39578f8

Browse files
committed
[RSC-142] Fix period length & remove traces
1 parent c8fa569 commit 39578f8

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

src/RSCoin/User/Operations.hs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ import qualified Data.Text as T
5656
import Data.Text.Buildable (Buildable)
5757
import qualified Data.Text.IO as TIO
5858
import Data.Tuple.Select (sel1, sel2, sel3)
59-
import Debug.Trace
6059
import Formatting (build, int, sformat, shown, (%))
6160
import Safe (atMay)
6261

@@ -252,12 +251,11 @@ importAddress st (skMaybe,pk) fromH = do
252251
" is current wallet's top known blockchain height."
253252
in commitError $ sformat formatPattern walletHeight walletHeight
254253
let period = [fromH..walletHeight]
255-
delta = max (walletHeight - fromH - 1) $
256-
max 100 $ (walletHeight - fromH) `div` 10
254+
perLength = walletHeight - fromH - 1
255+
delta = if perLength < 100
256+
then perLength
257+
else perLength `div` 10
257258
periodsLast = splitEvery delta period
258-
traceM $ "Period is : " ++ show period
259-
traceM $ "Delta is : " ++ show delta
260-
traceM $ "periods is : " ++ show periodsLast
261259
C.logInfo $ sformat
262260
("Starting blockchain query process for blocks " % int % ".." % int) fromH walletHeight
263261
hblocks <- (period `zip`) . concat <$>

0 commit comments

Comments
 (0)