mirror of
https://github.com/lightningnetwork/lnd.git
synced 2024-11-19 09:53:54 +01:00
lnwallet: add new DestOutputs field to TransactionDetail
A new `DestOutputs` field contains additional information on destinations of a transaction described with the `TransactionDetail` structure. The additional information inside `DestOuputs` denote the output script and amount, as well as a flag `IsOurAddress` if the address is controlled by the node's wallet.
This commit is contained in:
parent
42ca9b171e
commit
cbf6bd9aca
@ -12,6 +12,7 @@ import (
|
|||||||
"github.com/btcsuite/btcd/btcutil/hdkeychain"
|
"github.com/btcsuite/btcd/btcutil/hdkeychain"
|
||||||
"github.com/btcsuite/btcd/btcutil/psbt"
|
"github.com/btcsuite/btcd/btcutil/psbt"
|
||||||
"github.com/btcsuite/btcd/chaincfg/chainhash"
|
"github.com/btcsuite/btcd/chaincfg/chainhash"
|
||||||
|
"github.com/btcsuite/btcd/txscript"
|
||||||
"github.com/btcsuite/btcd/wire"
|
"github.com/btcsuite/btcd/wire"
|
||||||
"github.com/btcsuite/btcwallet/waddrmgr"
|
"github.com/btcsuite/btcwallet/waddrmgr"
|
||||||
"github.com/btcsuite/btcwallet/wallet/txauthor"
|
"github.com/btcsuite/btcwallet/wallet/txauthor"
|
||||||
@ -83,6 +84,16 @@ type Utxo struct {
|
|||||||
PrevTx *wire.MsgTx
|
PrevTx *wire.MsgTx
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// OutputDetail contains additional information on a destination address.
|
||||||
|
type OutputDetail struct {
|
||||||
|
OutputType txscript.ScriptClass
|
||||||
|
Addresses []btcutil.Address
|
||||||
|
PkScript []byte
|
||||||
|
OutputIndex int
|
||||||
|
Value btcutil.Amount
|
||||||
|
IsOurAddress bool
|
||||||
|
}
|
||||||
|
|
||||||
// TransactionDetail describes a transaction with either inputs which belong to
|
// TransactionDetail describes a transaction with either inputs which belong to
|
||||||
// the wallet, or has outputs that pay to the wallet.
|
// the wallet, or has outputs that pay to the wallet.
|
||||||
type TransactionDetail struct {
|
type TransactionDetail struct {
|
||||||
@ -120,6 +131,10 @@ type TransactionDetail struct {
|
|||||||
// DestAddresses are the destinations for a transaction
|
// DestAddresses are the destinations for a transaction
|
||||||
DestAddresses []btcutil.Address
|
DestAddresses []btcutil.Address
|
||||||
|
|
||||||
|
// OutputDetails contains output data for each destination address, such
|
||||||
|
// as the output script and amount.
|
||||||
|
OutputDetails []OutputDetail
|
||||||
|
|
||||||
// RawTx returns the raw serialized transaction.
|
// RawTx returns the raw serialized transaction.
|
||||||
RawTx []byte
|
RawTx []byte
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user