Bitcoin Forum
April 26, 2024, 12:59:22 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: How do i set the correct transaction fee automatically for users on a server? ++  (Read 468 times)
noobymcpherson (OP)
Newbie
*
Offline Offline

Activity: 2
Merit: 0


View Profile
February 19, 2014, 07:08:25 PM
Last edit: February 19, 2014, 07:35:05 PM by noobymcpherson
 #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.
Unlike traditional banking where clients have only a few account numbers, with Bitcoin people can create an unlimited number of accounts (addresses). This can be used to easily track payments, and it improves anonymity.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1714136362
Hero Member
*
Offline Offline

Posts: 1714136362

View Profile Personal Message (Offline)

Ignore
1714136362
Reply with quote  #2

1714136362
Report to moderator
1714136362
Hero Member
*
Offline Offline

Posts: 1714136362

View Profile Personal Message (Offline)

Ignore
1714136362
Reply with quote  #2

1714136362
Report to moderator
DannyHamilton
Legendary
*
Offline Offline

Activity: 3374
Merit: 4606



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 (OP)
Newbie
*
Offline Offline

Activity: 2
Merit: 0


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:  

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