lnwallet: add raw tx hex attribute to ListTransactionDetails

This commit is contained in:
Olaoluwa Osuntokun 2019-06-07 07:36:20 -07:00
parent 52b7603d25
commit eaf86cc4f9
No known key found for this signature in database
GPG Key ID: CE58F7F8E20FD9A2
2 changed files with 10 additions and 3 deletions

@ -512,8 +512,9 @@ func minedTransactionsToDetails(
var destAddresses []btcutil.Address
for _, txOut := range wireTx.TxOut {
_, outAddresses, _, err :=
txscript.ExtractPkScriptAddrs(txOut.PkScript, chainParams)
_, outAddresses, _, err := txscript.ExtractPkScriptAddrs(
txOut.PkScript, chainParams,
)
if err != nil {
return nil, err
}
@ -529,6 +530,7 @@ func minedTransactionsToDetails(
Timestamp: block.Timestamp,
TotalFees: int64(tx.Fee),
DestAddresses: destAddresses,
RawTx: tx.Transaction,
}
balanceDelta, err := extractBalanceDelta(tx, wireTx)
@ -597,7 +599,9 @@ func (b *BtcWallet) ListTransactionDetails() ([]*lnwallet.TransactionDetail, err
// TransactionDetail which re-packages the data returned by the base
// wallet.
for _, blockPackage := range txns.MinedTransactions {
details, err := minedTransactionsToDetails(currentHeight, blockPackage, b.netParams)
details, err := minedTransactionsToDetails(
currentHeight, blockPackage, b.netParams,
)
if err != nil {
return nil, err
}

@ -100,6 +100,9 @@ type TransactionDetail struct {
// DestAddresses are the destinations for a transaction
DestAddresses []btcutil.Address
// RawTx returns the raw serialized transaction.
RawTx []byte
}
// TransactionSubscription is an interface which describes an object capable of