rpcserver: handle unconfirmed TX properly when listing all transactions
This commit is contained in:
parent
3b2c807288
commit
10b976187d
@ -3014,11 +3014,18 @@ func (r *rpcServer) GetTransactions(ctx context.Context,
|
||||
destAddresses = append(destAddresses, destAddress.EncodeAddress())
|
||||
}
|
||||
|
||||
// We also get unconfirmed transactions, so BlockHash can be
|
||||
// nil.
|
||||
blockHash := ""
|
||||
if tx.BlockHash != nil {
|
||||
blockHash = tx.BlockHash.String()
|
||||
}
|
||||
|
||||
txDetails.Transactions[i] = &lnrpc.Transaction{
|
||||
TxHash: tx.Hash.String(),
|
||||
Amount: int64(tx.Value),
|
||||
NumConfirmations: tx.NumConfirmations,
|
||||
BlockHash: tx.BlockHash.String(),
|
||||
BlockHash: blockHash,
|
||||
BlockHeight: tx.BlockHeight,
|
||||
TimeStamp: tx.Timestamp,
|
||||
TotalFees: tx.TotalFees,
|
||||
|
Loading…
Reference in New Issue
Block a user