multi/refactor: move node ann modification outside of sign method

In preparation for moving feature bit modification inside of the
feature manager, separate node modification from signing.
This commit is contained in:
Carla Kirk-Cohen committed 2023-05-04 10:35:41 -04:00
1 parent c6b736b169
commit c6263c2fe6
2 files changed
+9 -12

No files matched your search

+4 -11
View File
@@ -60,18 +60,11 @@ func NodeAnnSetTimestamp(nodeAnn *lnwire.NodeAnnouncement) {
nodeAnn.Timestamp = newTimestamp
}
// SignNodeAnnouncement applies the given modifies to the passed
// lnwire.NodeAnnouncement, then signs the resulting announcement. The provided
// update should be the most recent, valid update, otherwise the timestamp may
// not monotonically increase from the prior.
// SignNodeAnnouncement signs the lnwire.NodeAnnouncement provided, which
// should be the most recent, valid update, otherwise the timestamp may not
// monotonically increase from the prior.
func SignNodeAnnouncement(signer lnwallet.MessageSigner,
keyLoc keychain.KeyLocator, nodeAnn *lnwire.NodeAnnouncement,
mods ...NodeAnnModifier) error {
// Apply the requested changes to the node announcement.
for _, modifier := range mods {
modifier(nodeAnn)
}
keyLoc keychain.KeyLocator, nodeAnn *lnwire.NodeAnnouncement) error {
// Create the DER-encoded ECDSA signature over the message digest.
sig, err := SignAnnouncement(signer, keyLoc, nodeAnn)