Modified rounding on DLCPayoutCurve interpolation to match spec (#2470)

This commit is contained in:
Nadav Kohen 2021-01-07 06:42:01 -06:00 committed by GitHub
parent ecc4532bf7
commit 141fc548bc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -171,7 +171,7 @@ sealed trait DLCPayoutCurveComponent {
protected def bigDecimalSats(bd: BigDecimal): Satoshis = { protected def bigDecimalSats(bd: BigDecimal): Satoshis = {
Satoshis( Satoshis(
bd.setScale(6, RoundingMode.HALF_UP) bd.setScale(6, RoundingMode.HALF_UP)
.setScale(0, RoundingMode.FLOOR) .setScale(0, RoundingMode.HALF_UP)
.toLongExact) .toLongExact)
} }
} }