<p>You can do <code>estimatesmartfee 6</code> to calculate suggested BTC/kB fee aiming confirmation in six blocks. Then you can do <code>fundrawtransaction &lt;tx&gt; "{feeRate: 0.000something}"</code> to add inputs with the specified fee. This way, you'll have more control over the fees.</p>

CC BY-SA 4.0
2018-08-28T10:07:57.903Z
2018-08-28T10:07:57.903Z
MCCCS
<p><a href="https://bitcoin.stackexchange.com/q/43532/86150">This</a> already summaries the issue I'm currently trying to figure out to calculate the transaction fee to prevent negative balance.</p>

<p>(testnet) I tried using <code>createrawtransaction</code> <a href="https://bitcoin.stackexchange.com/a/43601/86150">answered</a>.
When I tried to send all balance to an address, the <code>txid</code> was created successfully using <code>createrawtransaction</code> but when I ran the <code>fundrawtranaction</code> on that <code>txid</code> it showed</p>

<pre><code>error code: -4
error message:
Insufficient funds
</code></pre>

<p><s>The goal is to calculate transaction fee before hand to check either sufficient balance is available of an account using <code>sendfrom</code> </s></p>

<p>To manage multiple users to isolate users' balances as <a href="https://bitcointalk.org/index.php?topic=2904484.0" rel="nofollow noreferrer">this</a>.</p>

<p><strong>EDIT1:</strong></p>

<p>If using <code>estimatesmartfee</code> it is showing the fee:</p>

<pre><code>bitcoin-cli -testnet estimatesmartfee 6
{
  "feerate": 0.00501921,
  "blocks": 6
}
</code></pre>

<p>When calling <code>sendfrom</code> for total balance transfer:</p>

<pre><code>bitcoin-cli -testnet sendfrom &lt;account&gt; &lt;address&gt; &lt;amount&gt;
error code: -4
error message:
Error: This transaction requires a transaction fee of at least 0.00067257
</code></pre>

<p>Is there a way to get <code>0.00067257</code> the fee part before send the transaction amount and set it so that account balance won't go negative for multi accounts wallet.</p>

<p><strong>Edit 2:</strong></p>

<p>I found out that accounts are <a href="https://github.com/bitcoin-dot-org/bitcoin.org/issues/1287" rel="nofollow noreferrer">deprecated</a>.</p>

<p>And multi wallet creation/load/unload on runtime is underway to <a href="https://github.com/bitcoin/bitcoin/pull/13058" rel="nofollow noreferrer">0.17.0</a></p>

<p>So what would be the best approach to handle multiple users bitcoins in isolation on a full node to prevent negative balance.</p>

<wallet><bitcoind><transaction-fees><raw-transaction><bitcoin-cli>
Manage multiple users wallets for web wallet service
Shahbaz
# Manage multiple users wallets for web wallet service

(Asked by: username_0 on 2018-08-28)

[This](https://bitcoin.stackexchange.com/q/43532/86150) already summaries the issue I'm currently trying to figure out to calculate the transaction fee to prevent negative balance.

(testnet) I tried using `createrawtransaction` [answered](https://bitcoin.stackexchange.com/a/43601/86150).
When I tried to send all balance to an address, the `txid` was created successfully using `createrawtransaction` but when I ran the `fundrawtranaction` on that `txid` it showed

```
error code: -4
error message:
Insufficient funds

```

~~The goal is to calculate transaction fee before hand to check either sufficient balance is available of an account using `sendfrom`~~

To manage multiple users to isolate users' balances as [this](https://bitcointalk.org/index.php?topic=2904484.0).

**EDIT1:**

If using `estimatesmartfee` it is showing the fee:

```
bitcoin-cli -testnet estimatesmartfee 6
{
  "feerate": 0.00501921,
  "blocks": 6
}

```

When calling `sendfrom` for total balance transfer:

```
bitcoin-cli -testnet sendfrom <account> <address> <amount>
error code: -4
error message:
Error: This transaction requires a transaction fee of at least 0.00067257

```

Is there a way to get `0.00067257` the fee part before send the transaction amount and set it so that account balance won't go negative for multi accounts wallet.

**Edit 2:**

I found out that accounts are [deprecated](https://github.com/bitcoin-dot-org/bitcoin.org/issues/1287).

And multi wallet creation/load/unload on runtime is underway to [0.17.0](https://github.com/bitcoin/bitcoin/pull/13058)

So what would be the best approach to handle multiple users bitcoins in isolation on a full node to prevent negative balance.

**Tags:** wallet, bitcoind, transaction-fees, raw-transaction, bitcoin-cli


---

## 1 answers

### Answer by username_1 on 2018-08-28. Score: 0

You can do `estimatesmartfee 6` to calculate suggested BTC/kB fee aiming confirmation in six blocks. Then you can do `fundrawtransaction <tx> "{feeRate: 0.000something}"` to add inputs with the specified fee. This way, you'll have more control over the fees.


---

