Add miningaddr argument in generate
I'm working on a little testing tool for simnet & lnd nodes, and it would be extremely convenient if you could specify a miningaddr on the fly per generate, rather than at startup. I'm trying to make it easy to fund nodes quickly, but due to miningaddr only being configurable as a btcd argument, I would have to restart btcd each time to fund a node.
Ideally I'd instead like to generate a new address from the node, and generate a block with a command like btcctl generate 1 --miningaddr=[result from lncli newaddress here]. I'm not sure how generate and miningaddr are put together, but hopefully this wouldn't be too difficult.
I would like to see this as well. But I would suggest not touching generate and instead implementing generatetoaddress behaving the same as in bitcoin-cli.
I work on a testing tool for simnet clusters and I want to support both btcd/bitcoind as master backend node for mining into a faucet. Currently I have to branch the code (and have prior miningaddr config in btcd case).
https://github.com/darwin/simverse/blob/551b896c16aab7870520c3fbd5c3782bd2b40ab3/toolbox/generate#L8-L12
Related to https://github.com/btcsuite/btcd/pull/845
I have rebased off of the latest master and updated the approach on #1441. Please re-review, hoping to get it merged 🙏