code: function (data) {
      
      var reward = data.coinbasevalue;
      var rewardToPool = reward;
      
      var txOutputBuffers = [];
      
      for (var i = 0; i < context.fees.recipients.length; i++) {
          {
              var recipient = context.fees.recipients[i];
              
              var recipientReward = Math.floor(recipient.percent * reward);
              rewardToPool -= recipientReward;
              
              txOutputBuffers.push(Buffer.concat([
                      utils.packInt64LE(recipientReward),
                      utils.varIntBuffer(recipient.script.length),
                      recipient.script
                  ]));
          }
          
          txOutputBuffers.unshift(Buffer.concat([
                  utils.packInt64LE(rewardToPool),
                  utils.varIntBuffer(context.wallet.central.script.length),
                  context.wallet.central.script
              ]));
      }
      
      return Buffer.concat([
          utils.varIntBuffer(txOutputBuffers.length),
          Buffer.concat(txOutputBuffers)
      ]);
  }
docs: /*
  This function creates the generation transaction that accepts the reward for
  successfully mining a new block.
  For some (probably outdated and incorrect) documentation about whats kinda going on here,
  see: https://en.bitcoin.it/wiki/Protocol_specification#tx