Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot send out unconfirmed tx with RPC commands sendmany or sendtoaddress #381

Open
tbrannt opened this issue Apr 22, 2020 · 1 comment
Assignees

Comments

@tbrannt
Copy link

tbrannt commented Apr 22, 2020

To test certain scenarios it would be handy to be able to send out unconfirmed coins via the console. I found the following commands that I hoped enabled me to do this without crafting a raw tx: sendtoaddress and sendmany. Both - by default - do not allow sending of unconfirmed coins.

The Bitcoin Core RPC command sendtoaddress has the following arguments:

Arguments:
1. "dummy"               (string, required) Must be set to "" for backwards compatibility.
2. "amounts"             (string, required) A json object with addresses and amounts
    {
      "address":amount   (numeric or string) 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         (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) Allow this transaction to be replaced by a transaction with higher fees via BIP 125
7. conf_target            (numeric, optional) Confirmation target (in blocks)
8. "estimate_mode"      (string, optional, default=UNSET) The fee estimate mode, must be one of:
       "UNSET"
       "ECONOMICAL"
       "CONSERVATIVE"

The 7. conf_target arg is missing in BitcoinABC, why?

The sendmany command has the following args in BitcoinABC:

Arguments:
1. "dummy"               (string, required) Must be set to "" for backwards compatibility.
2. "amounts"             (string, required) A json object with addresses and amounts
    {
      "address":amount   (numeric or string) The bitcoin address is the key, the numeric amount (can be string) in BCH 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         (array, optional) A json array with addresses.
                           The fee will be equally deducted from the amount of each selected address.

But when I set the minconf arg to 0 it still tells me the following in the console:

Insufficient funds (code -6

Why is 0 not supported as minconf? Is there another way to send unconfirmed coins?

@jasonbcox
Copy link
Contributor

The most recent release (0.22.4) includes fixes that affect wallet balance and coin selection. Can you try out this version and let us know if it fixed this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants