Bitcoin Forum
November 12, 2024, 02:06:17 AM *
News: Latest Bitcoin Core release: 28.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: rpc command 'getnewaddress' returns used addresses?  (Read 468 times)
samspaces (OP)
Legendary
*
Offline Offline

Activity: 1453
Merit: 1030


View Profile
May 16, 2017, 02:11:38 AM
 #1

I was under the impression that the above mentioned rpc command in bitcoin core returns an unused bitcoin address.
After my last transaction I noticed when checking the confirmations, that the address had already received bitcoin.
My keypool has 10000 addresses, so lack of addresses can't be the issue. Is my understanding of the client wrong that 'getnewaddress' returns an unused address?

Thanks.
achow101
Moderator
Legendary
*
Offline Offline

Activity: 3542
Merit: 6886


Just writing some code


View Profile WWW
May 16, 2017, 02:37:10 AM
 #2

It should give you a new address every time. However, IIRC, there's sometimes it won't if the keypool has not been refilled recently. For the keypool to not be refilled recently, you would have had to have requested the number of addresses in your keypool since the last time your wallet was unlocked.

Could you post the debug.log?

samspaces (OP)
Legendary
*
Offline Offline

Activity: 1453
Merit: 1030


View Profile
May 16, 2017, 02:42:03 AM
 #3

It should give you a new address every time. However, IIRC, there's sometimes it won't if the keypool has not been refilled recently. For the keypool to not be refilled recently, you would have had to have requested the number of addresses in your keypool since the last time your wallet was unlocked.

Could you post the debug.log?

That is exactly what I thought. But that is impossible, I have 10000 addresses in this wallet & rarely use it. What kind of debug were you referring to? From the debug.log file?
achow101
Moderator
Legendary
*
Offline Offline

Activity: 3542
Merit: 6886


Just writing some code


View Profile WWW
May 16, 2017, 02:45:51 AM
 #4

What kind of debug were you referring to? From the debug.log file?
Yes, the debug.log file. It might have some info in there about why this happened. It also might not.

samspaces (OP)
Legendary
*
Offline Offline

Activity: 1453
Merit: 1030


View Profile
May 16, 2017, 02:56:31 AM
 #5

What kind of debug were you referring to? From the debug.log file?
Yes, the debug.log file. It might have some info in there about why this happened. It also might not.

It just occured to me, I have 2 copies of the blockchain.
They run identical wallet.dat files, but the first won't know that the second has given out an address.
That must be it. My bad.
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!