Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] Add ability for users to set a default change address #234

Merged
merged 1 commit into from
Jan 28, 2024

Conversation

blondfrogs
Copy link
Member

@blondfrogs blondfrogs commented Dec 21, 2023

Fluxpools have reported that they would like the ability to set a default change address for when the are sending payments to miners. The reason for this feature request is because normal transactions generate a new address to be the change address causing the wallet to grow in size.

To allow this type of feature fluxd now allows two new parameters to be passed to fluxd when starting the application or they can be placed in the flux.conf.

  • defaultchangeaddressmainnet= valid_mainnet_address
  • defaultchangeaddresstestnet= valid_testnet_address

The default change address will be assigned if it was passed to the application in either of the mechanisms above, it is a valid address for the network is belongs to, and it will only work with the following rpc calls

  • sendmany
  • sendtoaddress

The rpccall sendfrom defaults to sending the change back to the address that it is sending from. So the default change address will not be used when this rpc is used.

Tests to be completed before merging:

  • Set a testnet address into the defaultchangeaddressmainnet - Verify that the change address is not set and instead defaults to generating a new change address for the transaction when using sendmany and sendtoaddress
  • Set a mainnet address into the defaultchangeaddresstestnet - Verify that the change address is not set and instead defults to generating a new change address for the transaction when using sendmany and sendtoaddress
  • Set the defaultchange address to a invalid address string - Verify that the change address is not used and instead defaults to generating a new change address for the transaction
  • Set a valid address to be the change address - Verify that the address is used as the change address when using sendmany and sendtoaddress
  • Set a valid address to be the change address - Verify that the address isn't used when using sendfrom

@blondfrogs blondfrogs added the enhancement New feature or request label Dec 21, 2023
Copy link
Member

@w2vy w2vy left a comment

Choose a reason for hiding this comment

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

ack

@blondfrogs blondfrogs force-pushed the defaultchangeaddress branch from a73cf9c to b0d4c1c Compare January 26, 2024 16:26
@TheTrunk TheTrunk requested a review from Cabecinha84 January 28, 2024 11:38
Copy link
Member

@Cabecinha84 Cabecinha84 left a comment

Choose a reason for hiding this comment

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

Looks good!

@TheTrunk TheTrunk merged commit 96c9462 into master Jan 28, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants