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

Projects
None yet
3 participants
@Roasbeef
Copy link
Member

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.

Roasbeef added some commits Jun 7, 2019

@wpaulino
Copy link
Collaborator

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

This comment has been minimized.

Copy link
Contributor

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

This comment has been minimized.

Copy link
Collaborator

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

continuous-integration/travis-ci/pr The Travis CI build could not complete due to an error
Details
@yaslama

This comment has been minimized.

Copy link
Contributor

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
You can’t perform that action at this time.