i'm have problem on setting fee transfer BTC PHP JSON-RPC #9458

issue drsaluml opened this issue on January 2, 2017
  1. drsaluml commented at 6:33 PM on January 2, 2017: none

    Hi guys

    i'm have problem on setting fee transfer BTC, the code develop in PHP RPC, i've using commands agrument fee "settxfee" amount 0.0002 BTC then use "sendfrom" to transfer 0.00200000 BTC and then after execute i got fee result as 0.00009273 BTC , it's possible settxfee is not working correctly, please suggest me how to resolve this issue.

    PHP code test

    require_once('easybitcoin.php');
    $bitcoin = new Bitcoin('bitcoinrpc','xxxxxxxxxxxxxxxxxx','localhost','8332');
    $bitcoin->settxfee(0.00020000);
    $result[0] = $bitcoin->getinfo();
    $result[1] = $bitcoin->sendfrom('kernel','bbbbbbbbbbbbbbbbbbbbbb',0.00200000);
    $bitcoin->dump($result);
    

    Bitcoin getinfo

    Array
    (
        [0] => Array
            (
                [result] => Array
                    (
                        [version] => 130100
                        [protocolversion] => 70014
                        [walletversion] => 60000
                        [balance] => 0.00417854
                        [blocks] => 446297
                        [timeoffset] => -6
                        [connections] => 8
                        [proxy] => 
                        [difficulty] => 317688400354.03
                        [testnet] => 
                        [keypoololdest] => 1467389630
                        [keypoolsize] => 101
                        [paytxfee] => 0.0002
                        [relayfee] => 0.0002
                        [errors] => 
                    )
                [error] => 
                [id] => 2
                [status] => 200
                [method] => getinfo
            )
    )
    

    Transaction https://blockchain.info/tx/fb89d133495d88592e6c2a34501574f297c4c9ae71f65feb8fda1e92403fdb0d

  2. MarcoFalke commented at 7:42 PM on January 2, 2017: member

    Does the problem exist in Bitcoin Core? (i.e. the GUI debug window or rpc interface)

    Also, what version of Bitcoin Core?

  3. MarcoFalke added the label Questions and Help on Jan 2, 2017
  4. drsaluml commented at 7:48 PM on January 2, 2017: none

    Yes problem exist in Bitcoin Core , Bitcoin Core 0.13.1

    01

  5. sipa commented at 8:16 PM on January 2, 2017: member

    You're aware that settxfee sets the fee per kilobyte? The size of a transaction in bytes isn't know in advance. You can use the raw transaction API to see constructed transactions before broadcasting them, if you want more control.

  6. drsaluml commented at 5:12 AM on January 3, 2017: none

    If I want a fee high priority transaction , I want sample setting

    Sorry, my english is not good

  7. jonasschnelli commented at 7:37 AM on January 3, 2017: contributor

    Try to use

    1. estimatesmartfee <blocktarget> (2 if you want fast confirmation)
    2. createrawtransaction [] {'addr':<amount>}
    3. fundrawtransaction <hex> {'feeRate': <feerate_per_kb_form_step1>}
    4. optionally: check the fee
    5. singrawtransaction <hex>
    6. sendrawtransaction <hex>

    This is the preferred way that allows one to better control fees, etc.

  8. jonasschnelli commented at 7:38 AM on January 3, 2017: contributor

    Closing. This probably belongs to http://bitcoin.stackexchange.com (or similar).

  9. jonasschnelli closed this on Jan 3, 2017

  10. MarcoFalke commented at 12:23 PM on January 4, 2017: member

    This could also be #9466, as the fee per kb of the transaction does not match with settxfee.

  11. drsaluml commented at 4:52 AM on January 16, 2017: none

    Cannot send by account ?

    Try to use

    estimatesmartfee <blocktarget> (2 if you want fast confirmation)
    createrawtransaction [] {'addr':<amount>}
    fundrawtransaction <hex> {'feeRate': <feerate_per_kb_form_step1>}
    optionally: check the fee
    singrawtransaction <hex>
    sendrawtransaction <hex>

    This is the preferred way that allows one to better control fees, etc.

  12. MarcoFalke locked this on Sep 8, 2021

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-26 06:15 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me