}
func txOutToUtxos(tx *types.Tx, statusFail bool, blockHeight uint64) []*account.UTXO {
- validHeight := uint64(0)
- if tx.Inputs[0].InputType() == types.CoinbaseInputType {
- validHeight = blockHeight + consensus.ActiveNetParams.CoinbasePendingBlockNumber
- }
-
utxos := []*account.UTXO{}
for i, out := range tx.Outputs {
+ validHeight := uint64(0)
entryOutput, err := tx.Entry(*tx.ResultIds[i])
if err != nil {
log.WithFields(log.Fields{"module": logModule, "err": err}).Error("txOutToUtxos fail on get entryOutput")
if (statusFail && *out.AssetAmount().AssetId != *consensus.BTMAssetID) || out.AssetAmount().Amount == uint64(0) {
continue
}
+
+ if tx.Inputs[0].InputType() == types.CoinbaseInputType {
+ validHeight = blockHeight + consensus.ActiveNetParams.CoinbasePendingBlockNumber
+ }
+
utxo = &account.UTXO{
OutputID: *tx.OutputID(i),
AssetID: *out.AssetAmount().AssetId,