Equibit / wallet-ui

0 stars 1 forks source link

Buy offer fails silently if total price can't be expressed in satoshi #1161

Open Eternali opened 6 years ago

Eternali commented 6 years ago
  1. user tries to place a buy offer for a sell order with: 0.001 EQB quantity & 300000 BTC price
  2. if they enter 0.0006 EQB as their offer the total price will be 119.998 uBTC
  3. if they click next it will error silently: expected property "0.value" of type Satoshi, got Number 11999.800000000001

The problem seems to be a rounding one, the calculated total price isn't a valid amount so it can't be created. Everything must be rounded to the nearest satoshi.