Bitcoin Forum
December 12, 2017, 09:56:28 PM *
News: Latest stable version of Bitcoin Core: 0.15.1  [Torrent].
 
   Home   Help Search Donate Login Register  
Pages: [1]
  Print  
Author Topic: How do i set the correct transaction fee automatically for users on a server? ++  (Read 389 times)
noobymcpherson
Newbie
*
Offline Offline

Activity: 2


View Profile
February 19, 2014, 07:08:25 PM
 #1

Hi, im making a new bitcoin business but im having some trouble. I'm using bitcoind on the server.

Each user have an address and a bitcoind account and i move bitcoins between accounts regularly(with the 'move' command)...

If i send a transaction with a 0.0001 fee will it always go through? If not, is there any sample code(preferably php) that calculates necessary transaction fees so i can automate this for users whenever they withdraw funds?

EDIT: Ok, so iv'e found the paytxfee option. It seems to work. Will this be sufficient to ensure that funds can be withdrawn from my website and propagate through the network to the receiver?

Presuming this works. I still need to find an answer to the next question:

Also have i understood this correctly, the keypool uses an address whenever a new address is created AND a sendfrom command is executed? is this a 100% correct and full description of how it works?

So as a webdeveloper i need to find a way to refill the keypool when x amount of users have created a new account + number of sendfrom commands are executed?

Iv'e spent days googling and reading through obscure stackexchange comments to get this far.. would be nice if bitcoind was a bit more developer friendly.
1513115788
Hero Member
*
Offline Offline

Posts: 1513115788

View Profile Personal Message (Offline)

Ignore
1513115788
Reply with quote  #2

1513115788
Report to moderator
1513115788
Hero Member
*
Offline Offline

Posts: 1513115788

View Profile Personal Message (Offline)

Ignore
1513115788
Reply with quote  #2

1513115788
Report to moderator
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
1513115788
Hero Member
*
Offline Offline

Posts: 1513115788

View Profile Personal Message (Offline)

Ignore
1513115788
Reply with quote  #2

1513115788
Report to moderator
1513115788
Hero Member
*
Offline Offline

Posts: 1513115788

View Profile Personal Message (Offline)

Ignore
1513115788
Reply with quote  #2

1513115788
Report to moderator
DannyHamilton
Legendary
*
Online Online

Activity: 2002



View Profile
February 19, 2014, 07:34:41 PM
 #2

Each user have an address and a bitcoind account and i move bitcoins between accounts regularly(with the 'move' command)...

Most people discover that bitcoind "accounts" do not operate the way they expect them to.  Be very careful that you understand how bitcoind "accounts" are used, or you will end up with some significant problems.

If i send a transaction with a 0.0001 fee will it always go through?

Not necessarily.  That depends on how large the transaction is.

Also have i understood this correctly, the keypool uses an address whenever a new address is created AND a sendfrom command is executed?

Generally a key is used from the keypool whenever a new address is created OR a transaction is sent.

is this a 100% correct and full description of how it works?

No.  Not 100%.  If the transaction doesn't have any any "change" when sending, then there won't be any key used from the keypool.

So as a webdeveloper i need to find a way to refill the keypool when x amount of users have created a new account + number of sendfrom commands are executed?

I'm not certain about the "sendfrom" command, but when using the Bitcoin-Qt interface, the wallet automatically takes care of adding a new key to the pool everytime one is removed.  Hopefully someone with more knowledge about "sendfrom" will stop by to let you know how the keypool is managed when using that command.

noobymcpherson
Newbie
*
Offline Offline

Activity: 2


View Profile
February 19, 2014, 07:59:58 PM
 #3

Thank you for your prompt reply. I'm still a bit confused though. A number of sources say i should refill the keypool or else bitcoind will start using old addresses... Which would be quite the dev headache! i tried the bitcoind keypoolrefill command and a microsecond later it finished. I don't know if it did anything because i don't know how to get info about how many 'keys' or addresses i have left... Anyone knows?
Pages: [1]
  Print  
 
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!