Skip to content

Conversation

@morehouse
Copy link
Contributor

@morehouse morehouse commented May 16, 2023

We intend to eventually remove lnwire.WriteElement from LND in favor of the faster statically-typed write functions. Switch to using those faster functions in Pool.

Requested by @guggero on lightningnetwork/lnd#7690.

Pull Request Checklist

  • LndServices minimum version has been updated if new lnd apis/fields are
    used.

morehouse added 5 commits May 16, 2023 17:30
Move WriteElement[s] to the codec package so that packages other than
clientdb can use it.

For the codec package, we avoid depending on other packages within Pool
so that no circular dependencies develop. This requires us to move some
of the uintXX casting logic in clientdb/codec.go to call sites.
There are plans to remove lnwire.WriteElement entirely from LND in favor
of the faster statically-typed encoding functions. Switch to using those
faster functions.
Return directly when possible, rather than falling through to return
nil.
Copy link
Contributor

@guggero guggero left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, LGTM 🎉

@guggero guggero requested a review from ffranr May 17, 2023 08:31
Copy link
Contributor

@ffranr ffranr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me! Thanks for the well organised commit structure 👍

@guggero guggero merged commit a9902da into lightninglabs:master May 19, 2023
@morehouse morehouse deleted the lnwire_static_type_writes branch May 19, 2023 14:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants