Browse Source
Prior to this commit, passive observation of orderbook updates by bots such as ob-watcher was not able to keep track of nicks/bots that had disconnected and were no longer available, because non-directory peers do not get the network level disconnection event. After this commit, the directory nodes forward a variant of the "peerlist" control message, that was previously used only to send connection information from one non-directory peer to another (so that they could establish a new p2p connection if desired). Now a new version of that message adds an extra "D" field to indicate that this message is being used to inform that the relevant peer has disconnected from this directory node. Bubbling up the on_nick_leave event: it is already the case that the final on_nick_leave callback is only triggered by the disappearance of a nick from all available message channels (so that as long as a nick is perceived as being in at least one available message channel, its current offers are still maintained in the local database); this logic is now repeated one layer down, because the disconnection of a nick from one directory node may not mean it is shut down, so we only pass the on_nick_leave callback from the OnionMessageChannel object up to the MessageChannelCollection callback when the active_directories dict indicates that this particular nick is no longer available on any of our configured directory nodes.master
1 changed files with 80 additions and 26 deletions
Loading…
Reference in new issue