Bitcoin Forum
May 14, 2024, 06:41:41 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: slow creation of thansaction on big wallet.dat  (Read 1553 times)
kimon (OP)
Member
**
Offline Offline

Activity: 83
Merit: 10


View Profile WWW
July 05, 2015, 02:49:40 PM
 #1

Hello community!

My problem is that creation of outgoing transactions are very slow.

My wallet have ~1500 active bitcoin-addresses with total ~20000 input transaction and ~5000 output transactions in last half of the year.
Size of file wallet.dat is 240Mb
Bitcoin Core 0.10.2

I create outgoing payment with command:
bitcoin-cli sendfrom <fromaccount> <tobitcoinaddress> <amount>

So the problem is it takes about 60 seconds every time when I execute this command (on CPU FX6300,6-Core,3.5GHz). This is too slowly.
On new wallet with minimum addresses and transactions this command executed less than 1 second.

If I have 40000 incoming transactions will it takes for 2 minutes?! ((

Why it takes so long time? How it is possible to speed it up?

Please help me to solve this problem.
1715668901
Hero Member
*
Offline Offline

Posts: 1715668901

View Profile Personal Message (Offline)

Ignore
1715668901
Reply with quote  #2

1715668901
Report to moderator
"I'm sure that in 20 years there will either be very large transaction volume or no volume." -- Satoshi
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1715668901
Hero Member
*
Offline Offline

Posts: 1715668901

View Profile Personal Message (Offline)

Ignore
1715668901
Reply with quote  #2

1715668901
Report to moderator
1715668901
Hero Member
*
Offline Offline

Posts: 1715668901

View Profile Personal Message (Offline)

Ignore
1715668901
Reply with quote  #2

1715668901
Report to moderator
1715668901
Hero Member
*
Offline Offline

Posts: 1715668901

View Profile Personal Message (Offline)

Ignore
1715668901
Reply with quote  #2

1715668901
Report to moderator
achow101
Moderator
Legendary
*
Offline Offline

Activity: 3388
Merit: 6637


Just writing some code


View Profile WWW
July 05, 2015, 03:04:38 PM
 #2

The problem is the size. If your <fromaccount> is all of your addresses, then it must search through every single unspent output for every single address in the wallet. Since there are thousands of addresses and thousands of unspent outputs for each address, it can take a long time to search through everything in order to create your transaction.

Unfortunately, I don't know how you can speed this up, and I'm pretty sure that you can't speed it up. I would advise consolidating all of your Bitcoin into one address and create a new account in Bitcoin Core with only that address. It should be faster that way since it will only have to search through I address and a few unspent outputs.

kimon (OP)
Member
**
Offline Offline

Activity: 83
Merit: 10


View Profile WWW
July 05, 2015, 03:30:41 PM
 #3

it must search through every single unspent output for every single address in the wallet. Since there are thousands of addresses and thousands of unspent outputs for each address, it can take a long time to search through everything in order to create your transaction.
Does really wallet.dat has no indexes for unspent outputs?
Well known that in Relational-DB we can find 1 record from 1 million records less than for 1 second using indexes.
achow101
Moderator
Legendary
*
Offline Offline

Activity: 3388
Merit: 6637


Just writing some code


View Profile WWW
July 05, 2015, 04:00:59 PM
 #4

it must search through every single unspent output for every single address in the wallet. Since there are thousands of addresses and thousands of unspent outputs for each address, it can take a long time to search through everything in order to create your transaction.
Does really wallet.dat has no indexes for unspent outputs?
Well known that in Relational-DB we can find 1 record from 1 million records less than for 1 second using indexes.
I'm not sure. It isn't the wallet.dat but rather the levelDB databases that Bitcoin Core uses for everything. You should lookup some stuff about levelDB.

kimon (OP)
Member
**
Offline Offline

Activity: 83
Merit: 10


View Profile WWW
July 05, 2015, 05:36:45 PM
 #5

In this case I see something strange:
1. Execute command bitcoin-cli listunspent take a 5 second and return 107 unspent outputs;
2. After this command bitcoin-cli sendfrom <fromaccount> <tobitcoinaddress> <amount> nevertheless take 40 seconds.

knightdk if you are right, why so much difference in time?
achow101
Moderator
Legendary
*
Offline Offline

Activity: 3388
Merit: 6637


Just writing some code


View Profile WWW
July 05, 2015, 05:42:00 PM
 #6

In this case I see something strange:
1. Execute command bitcoin-cli listunspent take a 5 second and return 107 unspent outputs;
2. After this command bitcoin-cli sendfrom <fromaccount> <tobitcoinaddress> <amount> nevertheless take 40 seconds.

knightdk if you are right, why so much difference in time?
That is interesting. I thought that searching through everything and finding all of the unspent outputs would take up most of the time. The remaining 35 seconds could be from needing to sign each unspent output from a different address if they all went to different addresses and just the creation of the transaction. I'm not quite sure then.

kimon (OP)
Member
**
Offline Offline

Activity: 83
Merit: 10


View Profile WWW
July 06, 2015, 07:54:03 AM
 #7

May be this is some bag in Bitcoin Core.
Can some developer look at this problem?
jonas.schnelli
Member
**
Offline Offline

Activity: 66
Merit: 10

bitcoin core contributor


View Profile WWW
July 06, 2015, 06:25:27 PM
 #8

Just wanted you to know that I'm working on this problem by rewriting most of the bitcoin-cores wallet: https://github.com/jonasschnelli/bitcoin/tree/2015/05/corewallet

So help is on the way, but not for today and tomorrow.
kimon (OP)
Member
**
Offline Offline

Activity: 83
Merit: 10


View Profile WWW
July 21, 2015, 11:56:38 PM
 #9

In new Bitcoin Core v0.11.0 time of creation transaction (by sendfrom) reduced to about 20 second.
It's good! But is possible to faster?
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!