Previously, LiquidityManager (or at least its internal message queue) was holding a reference to PeerManager/impl APeerManager in order to be able to trigger message processing after new messages were enqueued.
However, this had two major drawbacks: firstly, it introduced an ugly (and hard to resolve) cycle in the type definitions as PeerManager depends on CustomMessageHandler, which in this case is LiquidityManager, itself depending on said PeerManager reference. Secondly, it introduced the complex PeerManager LDK object to the LSPS implementation which is otherwise not that depedent on LDK's internal types.
To resolve these issues, we heere replace the dependency on PeerManager/impl APeerManager with a simple generic callback that will be called every time new messages are enqueued.
Looking for feedback here. As a second step we could consider dropping the MessageQueue trait which was introduced as part of the prior refactor that moved the APeerManager bound from each individual message handler to the DefaultMessageQueue.
Fixes #72.
Previously,
LiquidityManager
(or at least its internal message queue) was holding a reference toPeerManager
/impl APeerManager
in order to be able to trigger message processing after new messages were enqueued.However, this had two major drawbacks: firstly, it introduced an ugly (and hard to resolve) cycle in the type definitions as
PeerManager
depends onCustomMessageHandler
, which in this case isLiquidityManager
, itself depending on saidPeerManager
reference. Secondly, it introduced the complexPeerManager
LDK object to the LSPS implementation which is otherwise not that depedent on LDK's internal types.To resolve these issues, we heere replace the dependency on
PeerManager
/impl APeerManager
with a simple generic callback that will be called every time new messages are enqueued.Looking for feedback here. As a second step we could consider dropping the
MessageQueue
trait which was introduced as part of the prior refactor that moved theAPeerManager
bound from each individual message handler to theDefaultMessageQueue
.