Bitcoin Forum

Bitcoin => Bitcoin Technical Support => Topic started by: lyhistory on March 12, 2019, 09:45:23 AM



Title: how to set a fixed coinbase address
Post by: lyhistory on March 12, 2019, 09:45:23 AM
bitcoincore version: v0.17.1
OS: ubuntu18.04

what I'm doing is testing with bitcoincore regtest mode, I find everytime it mine a block (bitcoin-cli -regtest generate 1), it will generate a new address to receive 50btc reward,
I'm wondering can I reuse the existing address to receive the reward.
I know it's not good to reuse btc address, but for simplicity in local testing, is there anyway to set a fixed coinbase address?
thanks


Title: Re: how to set a fixed coinbase address
Post by: Pmalek on March 12, 2019, 11:17:11 AM
I tried to find the answer you are looking for in the source below but with no luck. Maybe you or another user can find it or know what you need to do to use the same address, if it is possible.
https://bitcoin.org/en/developer-examples#regtest-mode


Title: Re: how to set a fixed coinbase address
Post by: abhiseshakana on March 28, 2019, 02:09:56 PM
bitcoincore version: v0.17.1
OS: ubuntu18.04

what I'm doing is testing with bitcoincore regtest mode, I find everytime it mine a block (bitcoin-cli -regtest generate 1), it will generate a new address to receive 50btc reward,
I'm wondering can I reuse the existing address to receive the reward.
I know it's not good to reuse btc address, but for simplicity in local testing, is there anyway to set a fixed coinbase address?
thanks

You can mine the block to your specified address by using bitcoin-cli -regtest generatetoaddress n "your_address"

n = the total blocks will generate.