mirror of
https://github.com/LBRYFoundation/lbcwallet.git
synced 2025-08-23 17:47:29 +00:00
multi-account: update sendmany
This commit is contained in:
parent
43bbf0a089
commit
af2d35a604
1 changed files with 9 additions and 2 deletions
|
@ -1649,6 +1649,7 @@ func sendFrom(icmd interface{}, w *wallet.Wallet, chainClient *chain.RPCClient)
|
||||||
// or a fee for the miner are sent back to a new address in the wallet.
|
// or a fee for the miner are sent back to a new address in the wallet.
|
||||||
// Upon success, the TxID for the created transaction is returned.
|
// Upon success, the TxID for the created transaction is returned.
|
||||||
func sendMany(icmd interface{}, w *wallet.Wallet) (interface{}, error) {
|
func sendMany(icmd interface{}, w *wallet.Wallet) (interface{}, error) {
|
||||||
|
|
||||||
cmd := icmd.(*btcjson.SendManyCmd)
|
cmd := icmd.(*btcjson.SendManyCmd)
|
||||||
|
|
||||||
// Transaction comments are not yet supported. Error instead of
|
// Transaction comments are not yet supported. Error instead of
|
||||||
|
@ -1660,7 +1661,7 @@ func sendMany(icmd interface{}, w *wallet.Wallet) (interface{}, error) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
account, err := w.AccountNumber(waddrmgr.KeyScopeBIP0044, cmd.FromAccount)
|
account, err := w.AccountNumber(cmd.FromAccount)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
@ -1671,6 +1672,12 @@ func sendMany(icmd interface{}, w *wallet.Wallet) (interface{}, error) {
|
||||||
return nil, ErrNeedPositiveMinconf
|
return nil, ErrNeedPositiveMinconf
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Use specified scope, if provided.
|
||||||
|
scope, err := lookupKeyScope(cmd.AddressType)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
// Recreate address/amount pairs, using dcrutil.Amount.
|
// Recreate address/amount pairs, using dcrutil.Amount.
|
||||||
pairs := make(map[string]btcutil.Amount, len(cmd.Amounts))
|
pairs := make(map[string]btcutil.Amount, len(cmd.Amounts))
|
||||||
for k, v := range cmd.Amounts {
|
for k, v := range cmd.Amounts {
|
||||||
|
@ -1681,7 +1688,7 @@ func sendMany(icmd interface{}, w *wallet.Wallet) (interface{}, error) {
|
||||||
pairs[k] = amt
|
pairs[k] = amt
|
||||||
}
|
}
|
||||||
|
|
||||||
return sendPairs(w, pairs, waddrmgr.KeyScopeBIP0044, account, minConf, txrules.DefaultRelayFeePerKb)
|
return sendPairs(w, pairs, scope, account, minConf, txrules.DefaultRelayFeePerKb)
|
||||||
}
|
}
|
||||||
|
|
||||||
// sendToAddress handles a sendtoaddress RPC request by creating a new
|
// sendToAddress handles a sendtoaddress RPC request by creating a new
|
||||||
|
|
Loading…
Add table
Reference in a new issue