sendmany over pays by few satoshis when setting addresses to take fees from #20396

issue beertastic opened this issue on November 15, 2020
  1. beertastic commented at 7:40 AM on November 15, 2020: none

    <!-- Describe the issue -->

    On TESTNET currently, sending this:

    bitcoin-cli -rpcport=18332 sendmany "" "{\"2N1xuawT4ndgDGR6g3Z3x8LR9oSvqjnN3jf\":0.000099,\"2N2HJYuPaJEmRvzvkRcQEUCyDRCy3LTFkWt\":0.000099}" 1 "" "[\"2N1xuawT4ndgDGR6g3Z3x8LR9oSvqjnN3jf\",\"2N2HJYuPaJEmRvzvkRcQEUCyDRCy3LTFkWt\"]" I'd expect in the transaction log for the amount and fee to add up to 0.000099

    However, it's consistently over by a few satoshis EG: −0.00009987 is the total of the above command for one of the addresses: Here is the transaction dump

    `18 => array:13 [▼

    "address" => "2N1xuawT4ndgDGR6g3Z3x8LR9oSvqjnN3jf"
    "category" => "send"
    "amount" => -9.9E-5
    "vout" => 2
    "fee" => -1.74E-6
    "confirmations" => 0
    "trusted" => true
    "txid" => "3db4c309feb48162f586945b657025b5da4bddf810306cda8383bb7bd46ee842"
    "walletconflicts" => []
    "time" => 1605425133
    "timereceived" => 1605425133
    "bip125-replaceable" => "no"
    "abandoned" => false

    ] 19 => array:13 [▼

    "address" => "2N2HJYuPaJEmRvzvkRcQEUCyDRCy3LTFkWt"
    "category" => "send"
    "amount" => -9.9E-5
    "vout" => 1
    "fee" => -1.74E-6
    "confirmations" => 0
    "trusted" => true
    "txid" => "3db4c309feb48162f586945b657025b5da4bddf810306cda8383bb7bd46ee842"
    "walletconflicts" => []
    "time" => 1605425133
    "timereceived" => 1605425133
    "bip125-replaceable" => "no"
    "abandoned" => false

    ]`

    is my node/wallet paying the extra?

    Expected behavior

    I'd expect the sum of amount and fee to equal the amount I'm sending out

    Actual behavior

    The total of sum and fee is MORE than the amount I specify

    To reproduce

    Run the bitcoin-cli command above and check the transaction data. (Feel free to change the addresses :) )

    System information

    <!-- What version of Bitcoin Core are you using, where did you get it (website, self-compiled, etc)? -->

    Bitcoin Core RPC client version v0.20.0 Self compiled

    <!-- What type of machine are you observing the error on (OS/CPU and disk type)? -->

    Google Hosted Linux (I think Ubnuntu, will check with my Dev Ops Manager)

    <!-- Any extra information that might be useful in the debugging process. -->

    There's no 'errors' per-se. it all seems to process, but the fee is too high.

    <!--- This is normally the contents of a `debug.log` or `config.log` file. Raw text or a link to a pastebin type site are preferred. -->

  2. beertastic added the label Bug on Nov 15, 2020
  3. sipa commented at 8:09 AM on November 15, 2020: member

    This is expected. If you want the fee to be deducted from the amount you're sending, you should use the "subtractFeeFromOutputs" option.

  4. beertastic commented at 8:11 AM on November 15, 2020: none

    I am... this is parameter 5: https://bitcoin-rpc.github.io/en/doc/0.17.99/rpc/wallet/sendmany/

    listing the addresses you want the fee distributed between.

    If I'm doing that wrong, I apologise.. but it looks as intended in my command?

  5. sipa commented at 8:15 AM on November 15, 2020: member

    My apologies, I missed that you were setting that.

  6. MarcoFalke added the label Wallet on Nov 15, 2020
  7. MarcoFalke renamed this:
    sendmany over pays when setting addresses to take fees from (Currently using testnet)
    sendmany over pays by few satoshis when setting addresses to take fees from (Currently using testnet)
    on Nov 15, 2020
  8. MarcoFalke renamed this:
    sendmany over pays by few satoshis when setting addresses to take fees from (Currently using testnet)
    sendmany over pays by few satoshis when setting addresses to take fees from
    on Nov 15, 2020
  9. beertastic commented at 8:21 AM on November 15, 2020: none

    No prob at all, cheers for trying! It's probably something simple.. even if it's the lsittransactions showing me the wrong fees or s'thing

  10. beertastic commented at 9:27 AM on November 16, 2020: none

    I'm an idiot. So the TX fee is assigned to each address transaction, but of course the TXID is the same. I was assuming (my biggest mistake) that it was applying a small fee to each address... But the fee column in the showtransactions function was a TOTAL fee for the TX.. so if divide the fee, by the number of addresses, it al adds up.

    I['m sorry.. ticket closing now... dur... :(

  11. beertastic closed this on Nov 16, 2020

  12. DrahtBot locked this on Feb 15, 2022
Contributors
Labels

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-21 15:14 UTC

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