* Sends the block to a node for processing on the network.
*
* The block must already be signed (see `sign()` for more information).
- * The block must also have a `work` value.
+ *
+ * If the block has no `work` value, `pow()` will be called automatically.
*
* @param {Rpc} rpc - RPC node information required to call `process`
* @returns {Promise<string>} Hash of the processed block
if (this.signature == null) {
throw new Error('Block is missing signature. Use sign() and try again.')
}
- if (this.work == null) {
- throw new Error('Block is missing proof-of-work. Use pow() and try again.')
- }
+ if (this.work == null) await this.pow()
const data = {
subtype: this.subtype,
json_block: true,