mirror of
https://github.com/bisq-network/bisq.git
synced 2024-11-19 18:03:12 +01:00
6e2400fb0f
Using the API's CLI to edit offers can sometimes result in add/remove messages being received on peers in the same batch of envolopes, and these messages are sometimes passed to the UI in (1) add, (2) remove order. This can result in a newly edited offer being removed immediately after being added to the OfferBook list. This change uses storage entry sequence number and storage entry payload hash comparisons to avoid the problem. - OfferBookListItem Added new constructor taking P2PDataStorage.ByteArray hashOfPayload, and int sequenceNumber params. Added a new toString() method. - OfferBook Added new checks on OfferBookListItem hashOfPayload and sequenceNumber while determining if offer candidates should be added or removed from the UI's OfferBook List. See OfferBook contructor's implementation of OfferBookChangedListener#onAdded and OfferBookChangedListener#onRemoved. Added many comments explaining the add/remove rules, and plenty of debug statements to help trace the add/remove event process. - OfferBookService#OfferBookChangedListener Added new P2PDataStorage.ByteArray hashOfPayload, and int sequenceNumber params to listener's onAdded and onRemoved method signatures. Added these two new paramater values to listener.onAdded and listener.onRemoved calls. - TakeOfferDataModel Replaced unused, old tradeManager param in offerBook.removeOffer() with (null) P2PDataStorage.ByteArray hashOfPayload, and (-1) int sequenceNumber params. OfferBook will remove the candidate offer as before. - MarketAlerts Adjusted onAdded() & onRemoved listener method signatures, even though new P2PDataStorage.ByteArray hashOfPayload, int sequenceNumber params are not used by the implementations. |
||
---|---|---|
.. | ||
package | ||
src |