Closed nhartner closed 1 year ago
@gregtatcam has a unit test reproducing what @nhartner is observing. It looks like the problem was introduced with the flowCross
amendment which went live August of 2020. @gregtatcam has offered to write an amendment with a fix.
Issue Description
CreateOffer
withtfFillOrKill
flag will always results in atecKILLED
result if the exchange rate on the offer is better than, but doesn't exactly match, the order book rate.Steps to Reproduce
Create 3 accounts and fund them with faucet:
Enable Default Ripple flag on ISSUER (ex. https://test.bithomp.com/explorer/424CF9443FBBE23734DF9E49BA2297D2A2ECE58C11F01B4EE8FD251F63E85A6C)
Create trustlines:
Send a payment of 100 units of currency ONE from ISSUER to MAKER (ex. https://test.bithomp.com/explorer/BBFBC0CB6B6ECE68050E8C57E7F7F33F0437D9EF03E638F74D70DFF5DBF1B06B)
Create an offer on MAKER account to sell 100 units of currency ONE for 100 XRP (ex. https://test.bithomp.com/explorer/DDFF0C28494332C491147A9A85AC8F5C1A988A848B4366271E72A67266AF5556)
Create an offer on TAKER account to buy 100 units of currency ONE for 101 XRP with
tfFillOrKill
flag (ex. https://test.bithomp.com/explorer/7251BC0895848886B9419FC1E209DABAAA2BE3BD66CB690BABFD92D660EA4743)Expected Result
Offer should fill and not be killed because TAKER is offering to pay 101 XRP for 100 ONE and maker is offering to sell 100 ONE for 100 XRP. Since TAKER is offering MORE XRP than the MAKER is asking, the order should match and execute with a
tesSUCCESS
result.Actual Result
Offer is killed with
tecKILLED
status. (see https://test.bithomp.com/explorer/7251BC0895848886B9419FC1E209DABAAA2BE3BD66CB690BABFD92D660EA4743)Note:
tfImmediateOrCancel
flag is used instead, the offer for 101 XRP for 100 ONE also gets fully matchedEnvironment
Reproduced on testnet and mainnet