code := []byte{}
switch resOut := tx.Entries[*tx.ResultIds[j]].(type) {
case *bc.IntraChainOutput:
+ if resOut.Source.Value.Amount == uint64(0) {
+ continue
+ }
code = resOut.ControlProgram.Code
case *bc.VoteOutput:
code = resOut.ControlProgram.Code
Vote: resOut.Vote,
}
default:
- log.WithFields(log.Fields{"module": logModule, "err": errors.Wrapf(bc.ErrEntryType, "entry %x has unexpected type %T", inpID.Bytes(), e)}).Error("txInToUtxos fail on get resOut")
continue
}
utxos = append(utxos, utxo)
func txOutToUtxos(tx *types.Tx, statusFail bool, blockHeight uint64) []*account.UTXO {
validHeight := uint64(0)
if tx.Inputs[0].InputType() == types.CoinbaseInputType {
- validHeight = blockHeight + consensus.CoinbasePendingBlockNumber
+ validHeight = blockHeight + consensus.ActiveNetParams.CoinbasePendingBlockNumber
}
utxos := []*account.UTXO{}
utxo := &account.UTXO{}
switch bcOut := entryOutput.(type) {
case *bc.IntraChainOutput:
- if statusFail && *out.AssetAmount().AssetId != *consensus.BTMAssetID {
+ if (statusFail && *out.AssetAmount().AssetId != *consensus.BTMAssetID) || out.AssetAmount().Amount == uint64(0) {
continue
}
utxo = &account.UTXO{
continue
}
- voteValidHeight := blockHeight + consensus.VotePendingBlockNumber
+ voteValidHeight := blockHeight + consensus.ActiveNetParams.VotePendingBlockNumber
if validHeight < voteValidHeight {
validHeight = voteValidHeight
}