breacharbiter: accept handoff for live channel on peer connect
This commit modifies the interaction between the breachArbiter and the peer struct such that the breachArbiter _always_ has the latest version of a contract. Prior to this commit once we connected out to a peer which we had an active contract with and the breachArbiter was watching, we’d have two copies of the channel in memory, instead of just a single one. This was wasteful and caused some duplicated log messages due to two instances of the channel being active.
This commit is contained in:
2 files changed
+20
-6
No files matched your search
@@ -232,7 +232,7 @@ func (p *peer) loadActiveChannels(chans []*channeldb.OpenChannel) error {
|
||||
|
||||
peerLog.Infof("peerID(%v) loaded ChannelPoint(%v)", p.id, chanPoint)
|
||||
|
||||
// TODO(roasbeef): register active channel with breach observer
|
||||
p.server.breachArbiter.newContracts <- lnChan
|
||||
|
||||
// Register this new channel link with the HTLC Switch. This is
|
||||
// necessary to properly route multi-hop payments, and forward
|
||||
|
||||
Reference in new issue
Block a user