<p>The main problem is the parameter <code>blocksonly=1</code> in bitcoin config file. This prevents the node to broadcast transactions to the netwrok. I removed it and it works fine!</p>

CC BY-SA 4.0
2020-05-08T08:55:52.513Z
2020-05-08T08:55:52.513Z
Emad Mamaghani
<p>Suppose this scenario:</p>
<blockquote>
<p>There are 2 wallets called <code>wallet1</code> and <code>wallet1</code> on the same node in <code>testnet</code> blockchain.</p>
<p><code>wallet1</code> balance: 0.001 BTC</p>
<p><code>wallet2</code> balance: 0 BTC</p>
</blockquote>
<p>I am trying to send 0.001 BTCs from <code>wallet1</code> to <code>wallet2</code>; so I use the <code>sendtoaddress</code> command like this:</p>
<p><code>bitcoin-cli -testnet -rpcwallet=wallet1 sendtoaddress &lt;wallet2 address&gt; 0.001 &quot;&quot; &quot;&quot; true</code>.</p>
<p>This gives me a <code>txid</code> which none of the blockchain explorers like <a href="https://live.blockcypher.com/btc-testnet" rel="nofollow noreferrer">live.blockcypher.com/btc-testnet</a> can't recognize it!</p>
<blockquote>
<p>It deducts the coin from <code>wallet1</code> and I don't know where does it go!?</p>
</blockquote>
<p>For solving this, I tried to get the transaction hex to broadcast it via some other platforms to check if the raw transaction is correct and it was OK and after broadcasting it via the other platform, blockchain explorers could detect the transaction id.</p>
<p>Here are my question:</p>
<ol>
<li>Isn't just using <code>sendtoaddress</code> enough for sending coins?</li>
<li>Why the broadcasting process doesn't complete on my node?</li>
</ol>
<p>Here is my <code>bitcoin.conf</code>:</p>
<pre><code>[test]
prune=600
blocksonly=1
maxconnections=15
testnet=1
regtest=0

deprecatedrpc=accounts
deprecatedrpc=addwitnessaddress
deprecatedrpc=signrawtransaction
deprecatedrpc=validateaddress

minrelaytxfee=0.0001
maxmempool=200
maxreceiverbuffer=2500
maxsendbuffer=500
dbcache=16000

rpcbind=0.0.0.0
rpcallowip=--

rpcuser=--
rpcpassword=--

server=1
rest=1
daemon=1
</code></pre>

CC BY-SA 4.0
2020-05-08T02:43:48.417Z
If it works when you broadcast the same transaction via explorers, then there is likely an issue with how your node connects to the testnet - your peers might not be broadcasting/accepting your transaction, or you just might not be connected at all
Raghav Sood
CC BY-SA 4.0
2020-05-08T07:04:30.653Z
@RaghavSood I think its connected because when I send bitcoin from an external wallet to my node based wallet, after confirmations, it detects the correct balance. I have searched about my problem and I think it might be because of the `bitcoin.conf`. I have used `blocksonly=1` in `test` block. Can it be the reason?
Emad Mamaghani
<bitcoin-core><json-rpc><bitcoin-cli>
Bitcoin core 0.19.1 RPC, 'sendtoaddress' not working!
Emad Mamaghani
# Bitcoin core 0.19.1 RPC, 'sendtoaddress' not working!

(Asked by: username_0 on 2020-05-07)

Suppose this scenario:

There are 2 wallets called wallet1 and wallet1 on the same node in testnet blockchain.
wallet1 balance: 0.001 BTC
wallet2 balance: 0 BTC

I am trying to send 0.001 BTCs from wallet1 to wallet2; so I use the sendtoaddress command like this:
bitcoin-cli -testnet -rpcwallet=wallet1 sendtoaddress  0.001 "" "" true.
This gives me a txid which none of the blockchain explorers like live.blockcypher.com/btc-testnet can't recognize it!

It deducts the coin from wallet1 and I don't know where does it go!?

For solving this, I tried to get the transaction hex to broadcast it via some other platforms to check if the raw transaction is correct and it was OK and after broadcasting it via the other platform, blockchain explorers could detect the transaction id.
Here are my question:

Isn't just using sendtoaddress enough for sending coins?
Why the broadcasting process doesn't complete on my node?

Here is my bitcoin.conf:
[test]
prune=600
blocksonly=1
maxconnections=15
testnet=1
regtest=0

deprecatedrpc=accounts
deprecatedrpc=addwitnessaddress
deprecatedrpc=signrawtransaction
deprecatedrpc=validateaddress

minrelaytxfee=0.0001
maxmempool=200
maxreceiverbuffer=2500
maxsendbuffer=500
dbcache=16000

rpcbind=0.0.0.0
rpcallowip=--

rpcuser=--
rpcpassword=--

server=1
rest=1
daemon=1

**Tags:** bitcoin-core, json-rpc, bitcoin-cli

> **Comments:**
> **username_1**: If it works when you broadcast the same transaction via explorers, then there is likely an issue with how your node connects to the testnet - your peers might not be broadcasting/accepting your transaction, or you just might not be connected at all  
> **username_0**: @RaghavSood I think its connected because when I send bitcoin from an external wallet to my node based wallet, after confirmations, it detects the correct balance. I have searched about my problem and I think it might be because of the `bitcoin.conf`. I have used `blocksonly=1` in `test` block. Can it be the reason?  

---

## 1 answers

### Answer by username_0 on 2020-05-08. Score: 2

The main problem is the parameter `blocksonly=1` in bitcoin config file. This prevents the node to broadcast transactions to the netwrok. I removed it and it works fine!


---

