0

Both commands generate blocks, and one specifies an address, what is the usage for each? Thanks!

1 Answer 1

1

generatetoaddress generates a block using transactions from the mempool. It uses the given address for the coinbase output.

generateblock generates a block with the given transactions in the given order. It does not automatically select transactions from the mempool like generatetoaddress does.

Both RPCs are only relevant on regtest and are used for testing. generatetoaddress is generally used when any unconfirmed transactions can be included in the block. generateblock is used when only some specific transactions should be included. generatetoaddress is also used to generate coins via coinbase transactions.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.