@@ -906,7 +906,7 @@ func (n *OpenBazaarNode) CalculateOrderTotal(contract *pb.RicardianContract) (*b
906
906
var (
907
907
total = big .NewInt (0 )
908
908
physicalGoods = make (map [string ]* pb.Listing )
909
- toHundreths = func (f float32 ) * big.Float {
909
+ toHundredths = func (f float32 ) * big.Float {
910
910
return new (big.Float ).Mul (big .NewFloat (float64 (f )), big .NewFloat (0.01 ))
911
911
}
912
912
)
@@ -935,9 +935,9 @@ func (n *OpenBazaarNode) CalculateOrderTotal(contract *pb.RicardianContract) (*b
935
935
itemOriginAmt = repo .NewCurrencyValueFromBigInt (GetOrderQuantity (l , item ), originDef )
936
936
937
937
if l .Metadata .PriceModifier != 0 {
938
- itemOriginAmt = itemOriginAmt .AddBigFloatProduct (toHundreths (l .Metadata .PriceModifier ))
938
+ itemOriginAmt = itemOriginAmt .AddBigFloatProduct (toHundredths (l .Metadata .PriceModifier ))
939
939
} else if l .Item .PriceModifier != 0 {
940
- itemOriginAmt = itemOriginAmt .AddBigFloatProduct (toHundreths (l .Item .PriceModifier ))
940
+ itemOriginAmt = itemOriginAmt .AddBigFloatProduct (toHundredths (l .Item .PriceModifier ))
941
941
}
942
942
} else {
943
943
oAmt , err := repo .NewCurrencyValueFromProtobuf (l .Item .BigPrice , l .Item .PriceCurrency )
@@ -980,7 +980,7 @@ func (n *OpenBazaarNode) CalculateOrderTotal(contract *pb.RicardianContract) (*b
980
980
itemOriginAmt = itemOriginAmt .SubBigInt (disc )
981
981
} else if discountF := vendorCoupon .GetPercentDiscount (); discountF > 0 {
982
982
// apply percentage discount
983
- itemOriginAmt = itemOriginAmt .AddBigFloatProduct (toHundreths (- discountF ))
983
+ itemOriginAmt = itemOriginAmt .AddBigFloatProduct (toHundredths (- discountF ))
984
984
}
985
985
}
986
986
}
@@ -990,7 +990,7 @@ func (n *OpenBazaarNode) CalculateOrderTotal(contract *pb.RicardianContract) (*b
990
990
for _ , tax := range l .Taxes {
991
991
for _ , taxRegion := range tax .TaxRegions {
992
992
if contract .BuyerOrder .Shipping .Country == taxRegion {
993
- itemOriginAmt = itemOriginAmt .AddBigFloatProduct (toHundreths (tax .Percentage ))
993
+ itemOriginAmt = itemOriginAmt .AddBigFloatProduct (toHundredths (tax .Percentage ))
994
994
break
995
995
}
996
996
}
@@ -1711,7 +1711,9 @@ func (n *OpenBazaarNode) ReserveCurrencyConverter() (*repo.CurrencyConverter, er
1711
1711
}
1712
1712
1713
1713
// priming the exchange rate cache
1714
- wal .ExchangeRates ().GetAllRates (false )
1714
+ if _ , err := wal .ExchangeRates ().GetAllRates (false ); err != nil {
1715
+ log .Warningf ("priming exchange rate cache: %s" , err .Error ())
1716
+ }
1715
1717
1716
1718
cc , err := repo .NewCurrencyConverter (reserveCode , wal .ExchangeRates ())
1717
1719
if err != nil {
0 commit comments