amin
amin

Reputation: 3852

Specify the (posiible) change address in sendmany bitcoin rpc call?

bitcoin sendmany api will add a change address if there is no combination of utxos that match the amount+fee.

How do i set the change address?
What is the default for change address?

Docs for reference:

sendmany "" {"address":amount} ( minconf "comment" ["address",...] replaceable conf_target "estimate_mode" )

Send multiple times. Amounts are double-precision floating point numbers.

Arguments:
1. dummy                     (string, required) Must be set to "" for backwards compatibility.
2. amounts                   (json object, required) A json object with addresses and amounts
     {
       "address": amount,    (numeric or string, required) The bitcoin address is the key, the numeric amount (can be string) in BTC is the value
     }
3. minconf                   (numeric, optional, default=1) Only use the balance confirmed at least this many times.
4. comment                   (string, optional) A comment
5. subtractfeefrom           (json array, optional) A json array with addresses.
                             The fee will be equally deducted from the amount of each selected address.
                             Those recipients will receive less bitcoins than you enter in their corresponding amount field.
                             If no addresses are specified here, the sender pays the fee.
     [
       "address",            (string) Subtract fee from this address
       ...
     ]
6. replaceable               (boolean, optional, default=fallback to wallet's default) Allow this transaction to be replaced by a transaction with higher fees via BIP 125
7. conf_target               (numeric, optional, default=fallback to wallet's default) Confirmation target (in blocks)
8. estimate_mode             (string, optional, default=UNSET) The fee estimate mode, must be one of:
                             "UNSET"
                             "ECONOMICAL"
                             "CONSERVATIVE"

Result:
"txid"                   (string) The transaction id for the send. Only 1 transaction is created regardless of 
                                    the number of addresses.

Upvotes: -1

Views: 514

Answers (1)

Fabricio Espinoza
Fabricio Espinoza

Reputation: 463

Technically you always pay the fee, default bitcoin core commands generate a new address automatically on each transaction. If you want to specify a change adress you should use createRawTransaction instead.

Upvotes: 1

Related Questions