@@ -121,14 +121,18 @@ func (handlers *Handlers) formatAmountAsJSON(amount coin.Amount, isFee bool) For
121121
122122func (handlers * Handlers ) formatAmountAtTimeAsJSON (amount coin.Amount , timeStamp * time.Time ) FormattedAmount {
123123 accountCoin := handlers .account .Coin ()
124- conversions , estimated := coin .ConversionsAtTime (
125- amount ,
126- handlers .account .Coin (),
127- false ,
128- handlers .account .Config ().RateUpdater ,
129- util .FormatBtcAsSat (handlers .account .Config ().BtcCurrencyUnit ),
130- timeStamp ,
131- )
124+ conversions := map [string ]string {}
125+ estimated := false
126+ if timeStamp != nil {
127+ conversions , estimated = coin .ConversionsAtTime (
128+ amount ,
129+ handlers .account .Coin (),
130+ false ,
131+ handlers .account .Config ().RateUpdater ,
132+ util .FormatBtcAsSat (handlers .account .Config ().BtcCurrencyUnit ),
133+ timeStamp ,
134+ )
135+ }
132136 return FormattedAmount {
133137 Amount : accountCoin .FormatAmount (amount , false ),
134138 Unit : accountCoin .GetFormatUnit (false ),
@@ -195,12 +199,12 @@ func (handlers *Handlers) getTxInfoJSON(txInfo *accounts.TransactionData, detail
195199 timestamp = txInfo .CreatedTimestamp
196200 }
197201
198- var deductedAmountAtTime FormattedAmount
202+ deductedAmountAtTime := handlers .formatAmountAtTimeAsJSON (txInfo .DeductedAmount , timestamp )
203+
199204 if timestamp != nil {
200205 t := timestamp .Format (time .RFC3339 )
201206 formattedTime = & t
202207 amountAtTime = handlers .formatAmountAtTimeAsJSON (txInfo .Amount , timestamp )
203- deductedAmountAtTime = handlers .formatAmountAtTimeAsJSON (txInfo .DeductedAmount , timestamp )
204208 }
205209
206210 addresses := []string {}
0 commit comments