File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -297,6 +297,13 @@ func (c *AssetPurchasePolicy) CheckHtlcCompliance(
297297 return fmt .Errorf ("error summing asset balance: %w" , err )
298298 }
299299
300+ // Due to rounding errors, we may slightly underreport the incoming
301+ // value of the asset. So we increase it by exactly one asset unit to
302+ // ensure that we do not reject the HTLC in the "inbound amount cannot
303+ // be less than outbound amount" check below.
304+ roundingCorrection := rfqmath .NewBigIntFromUint64 (1 )
305+ assetAmt = assetAmt .Add (roundingCorrection )
306+
300307 // Convert the inbound asset amount to millisatoshis and ensure that the
301308 // outgoing HTLC amount is not more than the inbound asset amount.
302309 assetAmtFp := new (rfqmath.BigIntFixedPoint ).SetIntValue (assetAmt )
You can’t perform that action at this time.
0 commit comments