OSDN Git Service
(root)
/
bytom
/
vapor.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix: add CrossChainInput in NewTxVMContext (#124)
[bytom/vapor.git]
/
protocol
/
txpool.go
diff --git
a/protocol/txpool.go
b/protocol/txpool.go
index
7d6bf9f
..
957ab6a
100644
(file)
--- a/
protocol/txpool.go
+++ b/
protocol/txpool.go
@@
-277,12
+277,21
@@
func (tp *TxPool) addTransaction(txD *TxDesc) error {
txD.Added = time.Now()
tp.pool[tx.ID] = txD
for _, id := range tx.ResultIds {
txD.Added = time.Now()
tp.pool[tx.ID] = txD
for _, id := range tx.ResultIds {
- output, err := tx.IntraChainOutput(*id)
+ var assetID bc.AssetID
+ outputEntry, err := tx.Entry(*id)
if err != nil {
if err != nil {
- // error due to it's a retirement, utxo doesn't care this output type so skip it
+ return err
+ }
+ switch output := outputEntry.(type) {
+ case *bc.IntraChainOutput:
+ assetID = *output.Source.Value.AssetId
+ case *bc.VoteOutput:
+ assetID = *output.Source.Value.AssetId
+ default:
continue
}
continue
}
- if !txD.StatusFail || *output.Source.Value.AssetId == *consensus.BTMAssetID {
+
+ if !txD.StatusFail || assetID == *consensus.BTMAssetID {
tp.utxo[*id] = tx
}
}
tp.utxo[*id] = tx
}
}