Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lnrpc: make ChannelPoint.funding_txid a protobuf oneof and change CloseChannel endpoint #592

Merged
merged 3 commits into from
Jan 31, 2018
Merged

Conversation

wpaulino
Copy link
Contributor

@wpaulino wpaulino commented Jan 11, 2018

Fixes #552.

This PR introduces the following changes:

  • Makes ChannelPoint's funding_txid a oneof between its bytes and string representation.
  • Updates the rest of lnd and lncli to handle the new proto update from above.
  • Changes the endpoint of CloseChannel to use the string representation funding_txid_str instead.

@wpaulino
Copy link
Contributor Author

wpaulino commented Jan 11, 2018

Forgot to update integration tests, will fix.

@wpaulino
Copy link
Contributor Author

Should be good for review now.

@Roasbeef
Copy link
Member

With #596 merged, can you rebase this now? Thanks!

@wpaulino
Copy link
Contributor Author

Rebased and made some minor nit changes.

@Roasbeef
Copy link
Member

Can you rebase this? Thanks!

@wpaulino
Copy link
Contributor Author

Rebased.

@Roasbeef
Copy link
Member

After the rebase, the build is broken:

./lnd_test.go:2410:42: cannot use chanPoint.FundingTxid (type lnrpc.isChannelPoint_FundingTxid) as type []byte in argument to "github.com/lightningnetwork/lnd/vendor/github.com/roasbeef/btcd/chaincfg/chainhash".NewHash
./lnd_test.go:2619:42: cannot use chanPoint.FundingTxid (type lnrpc.isChannelPoint_FundingTxid) as type []byte in argument to "github.com/lightningnetwork/lnd/vendor/github.com/roasbeef/btcd/chaincfg/chainhash".NewHash

This commit allows us to get/set the funding txid of a ChannelPoint
either as raw bytes or a string.
Since a ChannelPoint's funding txid can now be get/set as raw bytes or
a string, we first need to check what type it's currently set to before
accessing it.
@wpaulino
Copy link
Contributor Author

Should be good now.

@Roasbeef Roasbeef merged commit 1b15c30 into lightningnetwork:master Jan 31, 2018
@wpaulino wpaulino deleted the rest-close-channel branch February 7, 2018 06:56
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.

2 participants