Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
lnwallet+lnrpc: add ability to fetch the last unused wallet addr #2661
In this PR, we add the ability to fetch the last unused wallet address over the RPC interface. This is useful for end-users UIs as they can spam this call at will without having to worry about potentially unbounded "address inflation".
The current implementation simply adds two new (previously unused) address types. This makes it easy for any existing UIs, as they don't need to switch to a brand new call (or even update their protos), and can instead just pass in the new address type. The alternative was to add a new RPC call all together. I opted to not pursue this approach, as it seemed wasteful to add an entirely new RPC call for what is really a modification on an existing call. Also given that was have soooo many RPC methods, adding a new enum type seemed more conservative.
bjarnemagnussen left a comment
I just took a look at this PR to learn about the LND codebase and found a tiny typo in the comments :) Furthermore I got a question with the unit test, which for my own learning I hope you could find the time to answer me at some point.