@@ -121,18 +121,18 @@ func (handlers *Handlers) formatAmountAsJSON(amount coin.Amount, isFee bool) For
121
121
122
122
func (handlers * Handlers ) formatAmountAtTimeAsJSON (amount coin.Amount , timeStamp * time.Time ) FormattedAmount {
123
123
accountCoin := handlers .account .Coin ()
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
- }
124
+ if timeStamp == nil {
125
+ now := time . Now ()
126
+ timeStamp = & now
127
+ }
128
+ conversions , estimated := coin . ConversionsAtTime (
129
+ amount ,
130
+ handlers . account . Coin () ,
131
+ false ,
132
+ handlers .account .Config ().RateUpdater ,
133
+ util . FormatBtcAsSat ( handlers . account . Config (). BtcCurrencyUnit ) ,
134
+ timeStamp ,
135
+ )
136
136
return FormattedAmount {
137
137
Amount : accountCoin .FormatAmount (amount , false ),
138
138
Unit : accountCoin .GetFormatUnit (false ),
@@ -200,11 +200,11 @@ func (handlers *Handlers) getTxInfoJSON(txInfo *accounts.TransactionData, detail
200
200
}
201
201
202
202
deductedAmountAtTime := handlers .formatAmountAtTimeAsJSON (txInfo .DeductedAmount , timestamp )
203
+ amountAtTime = handlers .formatAmountAtTimeAsJSON (txInfo .Amount , timestamp )
203
204
204
205
if timestamp != nil {
205
206
t := timestamp .Format (time .RFC3339 )
206
207
formattedTime = & t
207
- amountAtTime = handlers .formatAmountAtTimeAsJSON (txInfo .Amount , timestamp )
208
208
}
209
209
210
210
addresses := []string {}
0 commit comments