1

Is there is any bitcoin RPC call for setting the transactions priority ?

  • you may want to rephrase your question, what do you mean exactly when you say "transaction priority". You just want it to confirm faster? This term also used to refer to a specific thing which no longer exists in new clients: bitcoin.stackexchange.com/questions/54583/… which can be confusing – kaykurokawa Dec 5 '18 at 15:56
1

The transaction priority is implied by the fee which you set for it. You can estimate the fee with your desired priority using https://bitcoincore.org/en/doc/0.16.0/rpc/util/estimatesmartfee/

Simply compute your transaction size (bytes) and adjust the transaction fee according to the sat/kB returned by the estimatesmartfee call.

  • Sorry James but how fee can be set , the above method is returning the estimate fee , Here is what i want to allow my wallet customer .. Suppose customer want that his transaction can be done fast and he is ready to pay more for the transaction fee . Which method allow me to do this – Pankaj Kumar Dec 5 '18 at 13:01
  • Are you using bitcoind wallet? If not, you need to compute the size of your signed transaction manually. Since you haven't signed it without knowing the fee, you can assume a DER signature to be 72 Bytes long, though it could be as short as 70. Then, make sure your output amounts - input amounts = feerate * tx_bytes. For scripting raw transactions, see en.bitcoin.it/wiki/… – James C. Dec 5 '18 at 13:06
  • i am using the bitcoin-cli – Pankaj Kumar Dec 5 '18 at 13:21
  • Ok - use createrawtransaction. But also try to understand the tx length you want to build (version, inputs, outputs, locktime, witness), so you know how many tx bytes you are dealing with. – James C. Dec 5 '18 at 13:25
  • James i am using the bitcoin RPC calls to send coin from one wallet to another. Suppose A user sending 0.01 BTC to B. 1) While sending how user A come to know how much fee will be applied 2) If A select custom fee , how that can be applied to the current transactions – Pankaj Kumar Jan 4 at 8:55
0

I have found the way to set the fee of a transctions

While sending the BTC to other user we need to use the sendmany rpc call to send BTC and set the replacble parameter as true

next user can use the bumpfee method to pass the txid along with the fee that need to be applied to the unconfirmed transactions

e.g txid=rpc_connection.sendmany("pks891618",{"2MzLYJLb14r6jJHzW9WQpAa5xERuV9EYvn3":0.9},1 ,"moneysend" ,[],True) print(rpc_connection.gettransaction(txid)) ftxid=rpc_connection.bumpfee(txid,{"totalFee":50000,"replaceable":True})

  • i guess transaction priority depends on the amount of fee you are willing to submit – cryptoKTM Jan 14 at 9:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.