Skip to content

Conversation

@danben
Copy link
Contributor

@danben danben commented Feb 23, 2021

As in fundrawtransaction, this gives the user the option to specify whether new inputs should be added when bumping the fee. See #20935

@ghost
Copy link

ghost commented Feb 24, 2021

Compiled successfully. Tests failed.

Tried experimenting with add_inputs:

  1. Transaction with 2 inputs selected manually and custom change address (A new receive address created and used as change):

FALSE

bumpfee fe60cda11767cd6c6c46a173a3ffa9cf3f71bc5f7af774ab641f6ede92fcd46a "{\"add_inputs\": false}"

Error:

Unable to create transaction. Insufficient funds (code -4)

TRUE

bumpfee fe60cda11767cd6c6c46a173a3ffa9cf3f71bc5f7af774ab641f6ede92fcd46a "{\"add_inputs\": true}"
{
  "txid": "2915edc7e7b8b375dc37a701146025b547903014e4a9652ba4dcb8cf77718ff8",
  "origfee": 0.00000208,
  "fee": 0.00005502,
  "errors": [
  ]
}
  1. Transaction with 2 inputs selected manually and custom change address (A new change address created and used as change):

FALSE

bumpfee 86d1a738d652d4511810cf9c820b4bb294edcaff845ab9559ce4c7c33543662f "{\"add_inputs\": false}"

No Error:

{
  "txid": "a1a564ae1983e1a87e731c4b9b205f3e8edbd724bb03d4474090f32ccd8f55a0",
  "origfee": 0.00000208,
  "fee": 0.00001248,
  "errors": [
  ]
}

Not sure if this option is really solving the issue or will help users until we fix other related issues.

… to that of the same option in the fundrawtransaction RPC.
@danben danben force-pushed the add-add-inputs-option-to-bumpfee branch from 40bde1a to 115b461 Compare February 25, 2021 18:15
@danben
Copy link
Contributor Author

danben commented Feb 25, 2021

@luke-jr I made the suggested change but am a little worried that it won't be clear to users what value to use if they don't want new inputs to be added.

@prayank23 I will look into what causes a change address to behave differently and possibly propose something. I agree that the current change will make things worse if the behavior is inconsistent.

@ghost
Copy link

ghost commented Feb 25, 2021

@danben Check #20795, bitcoin-core/gui#186 and #20598

@danben
Copy link
Contributor Author

danben commented Feb 27, 2021

@prayank23 How did you create the change address in your second test case (i.e. the one that behaved wrongly)? Did you use getrawchangeaddress or something else?

@ghost
Copy link

ghost commented Feb 28, 2021

@danben I used getnewaddress and getrawchangeaddress

Problem is with 2 things:

  1. Using address returned in getnewaddress or something that doesn't belong to wallet
  2. Using address which has a label even if it was created with getrawchangeaddress

@DrahtBot
Copy link
Contributor

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Conflicts

Reviewers, this pull request conflicts with the following ones:

If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

"are replaceable).\n"},
{"estimate_mode", RPCArg::Type::STR, /* default */ "unset", std::string() + "The fee estimate mode, must be one of (case insensitive):\n"
" \"" + FeeModes("\"\n\"") + "\""},
{"add_inputs", RPCArg::Type::STR, /* default */ "as_needed", "For a transaction with existing inputs, automatically include more if they are not enough."},
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't this be better as a plain bool?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@MarcoFalke That is what I had originally, but changed it to a string as per @luke-jr's suggestion from 2/23 (see above)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is the use case to force adding inputs if none are needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will defer to @luke-jr on that; I am not sure

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you misunderstood me. I meant the documentation should be accurate, not that "as_needed" should be a value. Documenting it as "true" suggested that inputs would be added even if not needed.

If the user wants "as needed", they just would omit "add_inputs" (or specify it as null). But I suppose defaults should be possible to specify explicitly, too, so not sure how to handle that. :)

@DrahtBot
Copy link
Contributor

DrahtBot commented Apr 1, 2021

🐙 This pull request conflicts with the target branch and needs rebase.

Want to unsubscribe from rebase notifications on this pull request? Just convert this pull request to a "draft".

@DrahtBot
Copy link
Contributor

There hasn't been much activity lately and the patch still needs rebase. What is the status here?
  • Is it still relevant? ➡️ Please solve the conflicts to make it ready for review and to ensure the CI passes.
  • Is it no longer relevant? ➡️ Please close.
  • Did the author lose interest or time to work on this? ➡️ Please close it and mark it 'Up for grabs' with the label, so that it can be picked up in the future.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants