autopilot/interface+agent: remove NodeKey from AttachmentDirective

Instead parse the pubkey bytes only when needed.
This commit is contained in:
Johan T. Halseth committed 2018-12-06 14:26:05 +01:00
1 parent 89c3c5319f
commit 5ecc209c41
5 files changed
+18 -28

No files matched your search

+6 -1
View File
@@ -574,8 +574,13 @@ func (a *Agent) executeDirective(directive AttachmentDirective) {
// We'll start out by attempting to connect to the peer in order to
// begin the funding workflow.
pub := directive.NodeKey
nodeID := directive.NodeID
pub, err := btcec.ParsePubKey(nodeID[:], btcec.S256())
if err != nil {
log.Errorf("Unable to parse pubkey %x: %v", nodeID, err)
return
}
alreadyConnected, err := a.cfg.ConnectToPeer(pub, directive.Addrs)
if err != nil {
log.Warnf("Unable to connect to %x: %v",