diff --git a/rpc/legacyrpc/methods.go b/rpc/legacyrpc/methods.go index 91daa2b..0de9ac6 100644 --- a/rpc/legacyrpc/methods.go +++ b/rpc/legacyrpc/methods.go @@ -1526,16 +1526,10 @@ func listAddressTransactions(icmd interface{}, w *wallet.Wallet) (interface{}, e // similar to ListTransactions, except it takes only a single optional // argument for the account name and replies with all transactions. func listAllTransactions(icmd interface{}, w *wallet.Wallet) (interface{}, error) { + cmd := icmd.(*btcjson.ListAllTransactionsCmd) - if cmd.Account != nil && *cmd.Account != "*" { - return nil, &btcjson.RPCError{ - Code: btcjson.ErrRPCInvalidParameter, - Message: "Listing all transactions may only be done for all accounts", - } - } - - return w.ListAllTransactions() + return w.ListAllTransactions(*cmd.Account) } // listUnspent handles the listunspent command. diff --git a/wallet/wallet.go b/wallet/wallet.go index 12d0f13..2991c0f 100644 --- a/wallet/wallet.go +++ b/wallet/wallet.go @@ -2172,7 +2172,7 @@ func (w *Wallet) ListAddressTransactions(pkHashes map[string]struct{}) ([]btcjso // ListAllTransactions returns a slice of objects with details about a recorded // transaction. This is intended to be used for listalltransactions RPC // replies. -func (w *Wallet) ListAllTransactions() ([]btcjson.ListTransactionsResult, error) { +func (w *Wallet) ListAllTransactions(accountName string) ([]btcjson.ListTransactionsResult, error) { txList := []btcjson.ListTransactionsResult{} err := walletdb.View(w.db, func(tx walletdb.ReadTx) error { txmgrNs := tx.ReadBucket(wtxmgrNamespaceKey) @@ -2187,7 +2187,8 @@ func (w *Wallet) ListAllTransactions() ([]btcjson.ListTransactionsResult, error) // unsorted, but it will process mined transactions in the // reverse order they were marked mined. for i := len(details) - 1; i >= 0; i-- { - jsonResults := listTransactions(tx, &details[i], w.Manager, + jsonResults := listTransactions(accountName, + tx, &details[i], w.Manager, syncBlock.Height, w.chainParams) txList = append(txList, jsonResults...) }