在sendmany比特币rpc呼叫中指定(可能的)更改地址?

时间:2019-06-02 02:07:55

标签: bitcoin bitcoind

如果没有与金额+费用匹配的utxos组合,

比特币sendmany api将添加一个更改地址。

如何设置更改地址?
更改地址的默认设置是什么?

参考文件:

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.

1 个答案:

答案 0 :(得分:1)

从技术上讲,您总是要付费,默认的比特币核心命令会在每次交易中自动生成一个新地址。如果要指定更改地址,则应改用createRawTransaction