lnrpc: display transaction label in transaction details

This commit is contained in:
carla 2020-05-18 14:13:24 +02:00
parent 52137459e4
commit e8ca306f12
No known key found for this signature in database
GPG Key ID: 4CA7FE54A6213C91
7 changed files with 756 additions and 729 deletions

File diff suppressed because it is too large Load Diff

View File

@ -708,6 +708,9 @@ message Transaction {
// The raw transaction hex.
string raw_tx_hex = 9;
// A label that was optionally set on transaction broadcast.
string label = 10;
}
message GetTransactionsRequest {
/*

View File

@ -4455,6 +4455,10 @@
"raw_tx_hex": {
"type": "string",
"description": "The raw transaction hex."
},
"label": {
"type": "string",
"description": "A label that was optionally set on transaction broadcast."
}
}
},

View File

@ -36,6 +36,7 @@ func RPCTransactionDetails(txns []*lnwallet.TransactionDetail) *TransactionDetai
TotalFees: tx.TotalFees,
DestAddresses: destAddresses,
RawTxHex: hex.EncodeToString(tx.RawTx),
Label: tx.Label,
}
}

View File

@ -93,6 +93,10 @@
"raw_tx_hex": {
"type": "string",
"description": "The raw transaction hex."
},
"label": {
"type": "string",
"description": "A label that was optionally set on transaction broadcast."
}
}
},

View File

@ -519,6 +519,7 @@ func minedTransactionsToDetails(
TotalFees: int64(tx.Fee),
DestAddresses: destAddresses,
RawTx: tx.Transaction,
Label: tx.Label,
}
balanceDelta, err := extractBalanceDelta(tx, wireTx)
@ -564,6 +565,7 @@ func unminedTransactionsToDetail(
Timestamp: summary.Timestamp,
DestAddresses: destAddresses,
RawTx: summary.Transaction,
Label: summary.Label,
}
balanceDelta, err := extractBalanceDelta(summary, wireTx)

View File

@ -103,6 +103,9 @@ type TransactionDetail struct {
// RawTx returns the raw serialized transaction.
RawTx []byte
// Label is an optional transaction label.
Label string
}
// TransactionSubscription is an interface which describes an object capable of