Skip to content

Commit

Permalink
multi-account: update gettransaction
Browse files Browse the repository at this point in the history
  • Loading branch information
roylee17 committed Sep 28, 2022
1 parent c42e8a0 commit e6a4b3d
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions rpc/legacyrpc/methods.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import (
"sync"
"time"

"github.com/lbryio/lbcd/blockchain"
"github.com/lbryio/lbcd/btcec"
"github.com/lbryio/lbcd/btcjson"
"github.com/lbryio/lbcd/chaincfg"
Expand Down Expand Up @@ -1011,15 +1012,13 @@ func getTransaction(icmd interface{}, w *wallet.Wallet) (interface{}, error) {
return nil, err
}

// TODO: Add a "generated" field to this result type. "generated":true
// is only added if the transaction is a coinbase.
ret := btcjson.GetTransactionResult{
TxID: cmd.Txid,
Hex: hex.EncodeToString(txBuf.Bytes()),
Time: details.Received.Unix(),
TimeReceived: details.Received.Unix(),
WalletConflicts: []string{}, // Not saved
//Generated: blockchain.IsCoinBaseTx(&details.MsgTx),
Generated: blockchain.IsCoinBaseTx(&details.MsgTx),
}

if details.Block.Height != -1 {
Expand Down Expand Up @@ -1094,7 +1093,7 @@ func getTransaction(icmd interface{}, w *wallet.Wallet) (interface{}, error) {
address = addr.EncodeAddress()
account, err := w.AccountOfAddress(addr)
if err == nil {
name, err := w.AccountName(waddrmgr.KeyScopeBIP0044, account)
name, err := w.AccountName(account)
if err == nil {
accountName = name
}
Expand Down

0 comments on commit e6a4b3d

Please sign in to comment.