Skip to content

Conversation

@maflcko
Copy link
Member

@maflcko maflcko commented Apr 7, 2018

The wallet header defined some globals (they were called "settings"), that should be class members instead.

This commit is hopefully only refactoring, apart from a multiwallet bugfix: Calling the rpc settxfee for one wallet, would set (and change) the fee rate for all loaded wallets. (See added test case)

@maflcko
Copy link
Member Author

maflcko commented Apr 7, 2018

For testing you can checkout this commit and run ./test/functional/wallet_multiwallet.py without compiling. It should fail.

@maflcko maflcko force-pushed the Mf1804-walletMembers branch from fa62e3b to 5a08c94 Compare April 7, 2018 18:50
@maflcko maflcko force-pushed the Mf1804-walletMembers branch 7 times, most recently from 1643a7c to fad3bc5 Compare April 9, 2018 18:36
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a reason not to make options like -discardfee and -mintxfee wallet members, the same way this is doing for -fallbackfee and -paytxfee options? It doesn't seem like a good thing to create a distinction here when moving the options together is possible.

Making more options members also seems nice in case we want to add a wallet RPC for changing preferences dynamically without affecting other wallets.

Copy link
Member Author

Choose a reason for hiding this comment

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

mintxfee et al are already members (static, though). I agree that those should be changed to be non-static members, but I'd rather do this in a follow up pr. Otherwise this one will explode in scope, scare away revierers and will gracelessly end up in rebase hell.

Copy link
Member Author

Choose a reason for hiding this comment

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

Making more options members also seems nice in case we want to add a wallet RPC for changing preferences dynamically without affecting other wallets.

Please see the included test case: We are already doing it wrong.

Copy link
Contributor

Choose a reason for hiding this comment

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

#12909 (comment)

mintxfee et al are already members (static, though). I agree that those should be changed to be non-static members, but I'd rather do this in a follow up pr. Otherwise this one will explode in scope, scare away revierers and will gracelessly end up in rebase hell.

I think "wallet-specific fee options" would be an appropriate scope for this PR and not too broad. The -mintxfee, -fallbackfee, -discardfee, and -paytxfee options are literally initialized one after another here, so it's strange to me that you want to move the second and fourth initializations but not the first and third based them on being global variables instead of static class member variables (since all the variables function identically).

@laanwj
Copy link
Member

laanwj commented Apr 11, 2018

Concept ACK

Copy link
Contributor

@ryanofsky ryanofsky left a comment

Choose a reason for hiding this comment

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

utACK fad3bc5cef786049f70ff485001e9e11791ef350

Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe revert this formatting change (this is what caused me to open #12982).

Copy link
Contributor

Choose a reason for hiding this comment

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

#12909 (comment)

mintxfee et al are already members (static, though). I agree that those should be changed to be non-static members, but I'd rather do this in a follow up pr. Otherwise this one will explode in scope, scare away revierers and will gracelessly end up in rebase hell.

I think "wallet-specific fee options" would be an appropriate scope for this PR and not too broad. The -mintxfee, -fallbackfee, -discardfee, and -paytxfee options are literally initialized one after another here, so it's strange to me that you want to move the second and fourth initializations but not the first and third based them on being global variables instead of static class member variables (since all the variables function identically).

@maflcko maflcko force-pushed the Mf1804-walletMembers branch 2 times, most recently from faac0e6 to fa04752 Compare April 14, 2018 14:44
@maflcko maflcko changed the title wallet: Make "settings" to be class members wallet: Make fee settings to be non-static members Apr 14, 2018
@maflcko maflcko force-pushed the Mf1804-walletMembers branch 5 times, most recently from fae9a4b to fa66188 Compare April 14, 2018 15:10
@maflcko
Copy link
Member Author

maflcko commented Apr 17, 2018

Removed static from three more members as requested by @ryanofsky

@jnewbery
Copy link
Contributor

p2p_compactblocks.py failed in Travis. Rebase on master to pick up fix?

@maflcko
Copy link
Member Author

maflcko commented Apr 17, 2018

@jnewbery Travis seems to fetch from git fetch origin +refs/pull/${PULL_NUMBER}/merge, so a re-run should suffice?

C.f. https://travis-ci.org/bitcoin/bitcoin/jobs/366515927#L356

Copy link
Contributor

@ryanofsky ryanofsky left a comment

Choose a reason for hiding this comment

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

utACK fa66188a5c8b862695dd8d730f7c900bfd303dcf. This is great cleanup! It's really nice to see these settings start to get consolidated and handled in a consistent way.

Copy link
Contributor

Choose a reason for hiding this comment

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

Comment is kind of misleading. I think it would be more accurate to say "overrides" instead of "overwrites" now.

Copy link
Member Author

Choose a reason for hiding this comment

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

TIL those words mean different things. Thx and done. Should be trivial to re-ACK if you still have the previous commit.

@maflcko maflcko force-pushed the Mf1804-walletMembers branch from fa66188 to fafdeca Compare April 17, 2018 22:00
Copy link
Contributor

@ryanofsky ryanofsky left a comment

Choose a reason for hiding this comment

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

utACK fafdeca1ec5d32291fe7b0313e123ad22d8e284b. Only change since the previous review is the updated RPC documentation string.

@maflcko maflcko force-pushed the Mf1804-walletMembers branch 2 times, most recently from b79c4d0 to eeeea3c Compare April 19, 2018 13:14
@maflcko
Copy link
Member Author

maflcko commented Apr 19, 2018

Clean rebase to reduce the diff (getting rid of deleted node-interface methods)

Copy link
Contributor

@ryanofsky ryanofsky left a comment

Choose a reason for hiding this comment

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

utACK eeeea3c066f8b1351b911593aac7b062f48f1976, only change since last review is rebase

Copy link
Contributor

@jnewbery jnewbery left a comment

Choose a reason for hiding this comment

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

utACK eeeea3c066f8b1351b911593aac7b062f48f1976 with request for follow-up commit.

Copy link
Contributor

Choose a reason for hiding this comment

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

Seems a little weird to change this to constexpr and leave all the other default constants as static const. It's fine, but can we have a follow-up PR to change the remaining constants to constexprs?

Copy link
Member Author

Choose a reason for hiding this comment

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

Sure. There is a bit of refactoring going on in the wallet, so I will wait until the dust settled a bit.

@laanwj
Copy link
Member

laanwj commented Apr 23, 2018

Sorry, needs rebase again

@laanwj laanwj self-assigned this Apr 23, 2018
@jonasschnelli
Copy link
Contributor

Concept ACK (utACK on eeeea3c066f8b1351b911593aac7b062f48f1976 which though requires rebase).

@maflcko maflcko force-pushed the Mf1804-walletMembers branch from eeeea3c to bcf4e8c Compare April 23, 2018 14:49
@maflcko maflcko force-pushed the Mf1804-walletMembers branch from bcf4e8c to fac0db0 Compare April 23, 2018 14:49
@maflcko
Copy link
Member Author

maflcko commented Apr 23, 2018

Rebased

Copy link
Contributor

@promag promag left a comment

Choose a reason for hiding this comment

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

This commit is hopefully only refactoring, apart from a multiwallet bugfix

Probably not that problematic, it's very unlikely someone depends on the current behavior, but I think this could have release note.

utACK fac0db0.

class RPCTimerInterface;
class UniValue;
class proxyType;
enum class FeeReason;
Copy link
Contributor

Choose a reason for hiding this comment

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

Also remove CCoinControl forward declaration?

Copy link
Member Author

Choose a reason for hiding this comment

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

Will leave it in for now, because I don't want to go through another rebase-reACK iteration just for this. Also, there are redundant forward declarations in other parts of the code, so this is not making the overall problem worse.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, don't mind that, just noted in case you have to push again.

@jnewbery
Copy link
Contributor

I think this could have release note.

I don't think it's necessary. We don't add notes for every bugfix, and this seems very trivial.

@jnewbery
Copy link
Contributor

tested ACK fac0db0

@laanwj laanwj merged commit fac0db0 into bitcoin:master Apr 24, 2018
laanwj added a commit that referenced this pull request Apr 24, 2018
fac0db0 wallet: Make fee settings non-static members (MarcoFalke)

Pull request description:

  The wallet header defined some globals (they were called "settings"), that should be class members instead.

  This commit is hopefully only refactoring, apart from a multiwallet bugfix: Calling the rpc `settxfee` for one wallet, would set (and change) the fee rate for all loaded wallets. (See added test case)

Tree-SHA512: 4ab6ec2f5c714742396ded5e451ec3b1ceb771e3696492de29889d866de4365b3fbe4a2784d085c8b8bd11b1ebb8a1fec99ab2c62eee716791cfc67c0cf29e1b
@maflcko maflcko deleted the Mf1804-walletMembers branch April 24, 2018 14:47
UdjinM6 pushed a commit to UdjinM6/dash that referenced this pull request May 22, 2021
fac0db0 wallet: Make fee settings non-static members (MarcoFalke)

Pull request description:

  The wallet header defined some globals (they were called "settings"), that should be class members instead.

  This commit is hopefully only refactoring, apart from a multiwallet bugfix: Calling the rpc `settxfee` for one wallet, would set (and change) the fee rate for all loaded wallets. (See added test case)

Tree-SHA512: 4ab6ec2f5c714742396ded5e451ec3b1ceb771e3696492de29889d866de4365b3fbe4a2784d085c8b8bd11b1ebb8a1fec99ab2c62eee716791cfc67c0cf29e1b
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Sep 8, 2021
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.

6 participants