Make sure we only mine via the first wallet#10649
Make sure we only mine via the first wallet#10649jonasschnelli wants to merge 1 commit intobitcoin:masterfrom
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.
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.