Bitcoin Forum
September 19, 2024, 02:54:14 PM *
News: Latest Bitcoin Core release: 27.1 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Is it bug with Bitcoin Core? Cannot transfer using sendtoaddress  (Read 211 times)
Advansist (OP)
Newbie
*
Offline Offline

Activity: 4
Merit: 0


View Profile
July 11, 2018, 08:45:53 PM
 #1

$ bitcoin-cli getbalance ""
1.90993320

------------------------------------

$ bitcoin-cli getbalance
0.00000000

------------------------------------

$ bitcoin-cli listunspent
[
]

------------------------------------

$ bitcoin-cli listaccounts
{
  "": 1.90993320,
  "acc1": 0.00000000,
  "acc2": 0.00000000,
  "acc3": 0.00000000,
  "acc4": 0.00000000,
  "acc5": 0.00000000
}

------------------------------------

bitcoin-cli sendtoaddress 2MvhWof9bB2Vjh5WYDkT8YrbzSodoTYjGto 1
error code: -6
error message:
Insufficient funds






Advansist (OP)
Newbie
*
Offline Offline

Activity: 4
Merit: 0


View Profile
July 11, 2018, 08:59:03 PM
 #2

I happend after the transaction is made between addresses at the same wallet using bitcoin-cli sendtoaddress...
The result of getbalance command became 0.00000000
achow101
Moderator
Legendary
*
Offline Offline

Activity: 3500
Merit: 6833


Just writing some code


View Profile WWW
July 11, 2018, 10:25:27 PM
 #3

This is a known problem with the accounts system used by Bitcoin Core which is being removed.

Calling getbalance with no arguments vs calling getbalance with arguments actually uses different algorithms for calculating the balance. I would say that with no arguments (so bitcoin-cli getbalance) is more correct than with specifying an account. It should, under normal circumstances, give you the full balance of the wallet. It uses the same function that is used for checking whether the wallet has enough funds for sending too, which is why you see an error when trying to use sendtoaddress.

There have been several issues and pull requests discussing the strange behavior of getbalance.

Advansist (OP)
Newbie
*
Offline Offline

Activity: 4
Merit: 0


View Profile
July 11, 2018, 10:46:50 PM
Last edit: July 11, 2018, 10:59:24 PM by Advansist
 #4

Thank you! It seams to me the problem with listunspent also.

I've got the balance back by abandontransaction command.

Advansist (OP)
Newbie
*
Offline Offline

Activity: 4
Merit: 0


View Profile
July 13, 2018, 12:25:03 PM
 #5

How to restore the state of the wallet in the case?

abandontransaction works 50%/50%

rescan does not help...
achow101
Moderator
Legendary
*
Offline Offline

Activity: 3500
Merit: 6833


Just writing some code


View Profile WWW
July 13, 2018, 06:49:47 PM
 #6

How to restore the state of the wallet in the case?

abandontransaction works 50%/50%

rescan does not help...
You can start Bitcoin Core with -zapwallettxes. That will remove all transactions from your wallet and rescan.

Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!