-
Notifications
You must be signed in to change notification settings - Fork 38.7k
Make sure we only mine via the first wallet #10649
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
Make sure we only mine via the first wallet #10649
Conversation
|
I proposed this before but not sure what the outcome of the discussion was - what about making |
ryanofsky
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested ACK b43a646. This is a good fix for current unpredictable behavior. It's hard to write python tests that depend on multiwallet without this.
I proposed this before but not sure what the outcome of the discussion was - what about making generate a wallet method?
Seems like a good idea. Would you lose the ability to generate blocks when wallet is disabled (if we even have this ability)?
No-
See #10683. |
|
I think #10683 is a better solution here. |
|
Closing in favor of #10683 |
This makes it possible to mine to any wallet when multi-wallet mode is added. Solves the same problem as bitcoin#10649, but IMO in a cleaner way. It also gets rid of the circuitous `ScriptForMining` method on `CValidationInterface`, which really doesn't belong there. After this change it's still possible to mine without wallet through `generatetoaddress`.
This makes it possible to mine to any wallet when multi-wallet mode is added. Solves the same problem as bitcoin#10649, but IMO in a cleaner way. It also gets rid of the circuitous `ScriptForMining` method on `CValidationInterface`, which really doesn't belong there. After this change it's still possible to mine without wallet through `generatetoaddress`. Conflicts: src/rpc/mining.cpp src/rpc/mining.h src/validationinterface.cpp src/validationinterface.h src/wallet/rpcwallet.cpp
If one used
generatewhile running with multiple wallets-wallet=file1.dat wallet=file2.datthe wallet used for the coinbase script is pretty undefined (or lets say weak defined, it's probably always the last one).This PR is a quick fix (should be okay for the internal miner) to ensure we always use the first wallet for
generate | setgenerate.Ideally, someone works on passing the endpoint (coming soon) down to the signal listener.