Bitcoin-ABC / Bitcoin-ABC/bitcoin-abc

Cannot send out unconfirmed tx with RPC commands sendmany or sendtoaddress

Open
#381 1 comment 0 reactions 1 assignee Claimed by @jasonbcox View on GitHub
Dominant language
C++
Stars
1.3k
Forks
788
PR merge metrics
No merged PRs in 30d

Description

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?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.