mirror of
https://github.com/LBRYFoundation/lbcwallet.git
synced 2025-08-23 17:47:29 +00:00
multi-account: update gettransaction
This commit is contained in:
parent
c42e8a0705
commit
e6a4b3d1fd
1 changed files with 3 additions and 4 deletions
|
@ -16,6 +16,7 @@ import (
|
||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"github.com/lbryio/lbcd/blockchain"
|
||||||
"github.com/lbryio/lbcd/btcec"
|
"github.com/lbryio/lbcd/btcec"
|
||||||
"github.com/lbryio/lbcd/btcjson"
|
"github.com/lbryio/lbcd/btcjson"
|
||||||
"github.com/lbryio/lbcd/chaincfg"
|
"github.com/lbryio/lbcd/chaincfg"
|
||||||
|
@ -1011,15 +1012,13 @@ func getTransaction(icmd interface{}, w *wallet.Wallet) (interface{}, error) {
|
||||||
return nil, err
|
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{
|
ret := btcjson.GetTransactionResult{
|
||||||
TxID: cmd.Txid,
|
TxID: cmd.Txid,
|
||||||
Hex: hex.EncodeToString(txBuf.Bytes()),
|
Hex: hex.EncodeToString(txBuf.Bytes()),
|
||||||
Time: details.Received.Unix(),
|
Time: details.Received.Unix(),
|
||||||
TimeReceived: details.Received.Unix(),
|
TimeReceived: details.Received.Unix(),
|
||||||
WalletConflicts: []string{}, // Not saved
|
WalletConflicts: []string{}, // Not saved
|
||||||
//Generated: blockchain.IsCoinBaseTx(&details.MsgTx),
|
Generated: blockchain.IsCoinBaseTx(&details.MsgTx),
|
||||||
}
|
}
|
||||||
|
|
||||||
if details.Block.Height != -1 {
|
if details.Block.Height != -1 {
|
||||||
|
@ -1094,7 +1093,7 @@ func getTransaction(icmd interface{}, w *wallet.Wallet) (interface{}, error) {
|
||||||
address = addr.EncodeAddress()
|
address = addr.EncodeAddress()
|
||||||
account, err := w.AccountOfAddress(addr)
|
account, err := w.AccountOfAddress(addr)
|
||||||
if err == nil {
|
if err == nil {
|
||||||
name, err := w.AccountName(waddrmgr.KeyScopeBIP0044, account)
|
name, err := w.AccountName(account)
|
||||||
if err == nil {
|
if err == nil {
|
||||||
accountName = name
|
accountName = name
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue