return nil, err
}
- byteData, err := txData.MarshalText()
- if err != nil {
- return nil, err
- }
- txData.SerializedSize = uint64(len(byteData))
-
tx = &types.Tx{
TxData: *txData,
Tx: types.MapTx(txData),
// restructCoinbaseTx build coinbase transaction with aggregate outputs when it achieved the specified block height
func restructCoinbaseTx(tx *types.Tx, rewards []state.CoinbaseReward) error {
- if len(rewards) == 0 {
- return nil
- }
-
for _, r := range rewards {
tx.Outputs = append(tx.Outputs, types.NewIntraChainOutput(*consensus.BTMAssetID, r.Amount, r.ControlProgram))
}