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

multi: add raw tx hex to GetTransactions response #3174

Merged

Conversation

@Roasbeef
Copy link
Member

@Roasbeef Roasbeef commented Jun 7, 2019

In this PR we add the raw tx hex to the GetTransactions call. This is useful as it's now possible to obtain the entire transaction to examine things like the tx ins/outs. Additionally, once #3140 is in, callers can use this to locate change outputs for transaction we send to use for CPFP fee bumping.

Copy link
Collaborator

@wpaulino wpaulino left a comment

LGTM ⚡️

Would be nice to add a check within one of the lnwallet tests to make sure the raw bytes deserialize into the expected transaction.

@yaslama
Copy link
Contributor

@yaslama yaslama commented Jun 10, 2019

@Roasbeef @wpaulino What do you think about adding the same field in the transactions sent in the stream returned by SubscribeTransactions? There is already a PR about destAddresses (#1933), and I can improve it to add RawTxHex.

@wpaulino
Copy link
Collaborator

@wpaulino wpaulino commented Jun 10, 2019

@yaslama SGTM. It should probably be included in this PR.

@Roasbeef Roasbeef merged commit faf0dc3 into lightningnetwork:master Jun 12, 2019
1 check failed
@yaslama
Copy link
Contributor

@yaslama yaslama commented Jun 12, 2019

@Roasbeef @wpaulino The field RawTx needs to be filled in unminedTransactionsToDetail:

diff --git a/lnwallet/btcwallet/btcwallet.go b/lnwallet/btcwallet/btcwallet.go
index 522aac6d..8a45623c 100644
--- a/lnwallet/btcwallet/btcwallet.go
+++ b/lnwallet/btcwallet/btcwallet.go
@@ -561,6 +561,7 @@ func unminedTransactionsToDetail(
                Hash:      *summary.Hash,
                TotalFees: int64(summary.Fee),
                Timestamp: summary.Timestamp,
+               RawTx:     summary.Transaction,
        }
 
        balanceDelta, err := extractBalanceDelta(summary, wireTx)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants