X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=protocol%2Fstate%2Futxo_view.go;h=00aaf7bd4ef049324318ac5f30602f17097564f4;hb=d3e343fbb36877d03468e27a3bc8df62cb5943bd;hp=c68ad9a6b9c606885d6b5d07bcf28b3a4e1c4196;hpb=0549867239f9b0cec8a384e18c19ea89815a3962;p=bytom%2Fbytom.git diff --git a/protocol/state/utxo_view.go b/protocol/state/utxo_view.go index c68ad9a6..00aaf7bd 100644 --- a/protocol/state/utxo_view.go +++ b/protocol/state/utxo_view.go @@ -21,7 +21,7 @@ func NewUtxoViewpoint() *UtxoViewpoint { func (view *UtxoViewpoint) ApplyTransaction(block *bc.Block, tx *bc.Tx) error { for _, prevout := range tx.SpentOutputIDs { - _, err := tx.Output(prevout) + _, err := tx.OriginalOutput(prevout) if err != nil { return err } @@ -40,7 +40,7 @@ func (view *UtxoViewpoint) ApplyTransaction(block *bc.Block, tx *bc.Tx) error { } for _, id := range tx.TxHeader.ResultIds { - _, err := tx.Output(*id) + _, err := tx.OriginalOutput(*id) if err != nil { // error due to it's a retirement, utxo doesn't care this output type so skip it continue @@ -71,7 +71,7 @@ func (view *UtxoViewpoint) CanSpend(hash *bc.Hash) bool { func (view *UtxoViewpoint) DetachTransaction(tx *bc.Tx) error { for _, prevout := range tx.SpentOutputIDs { - _, err := tx.Output(prevout) + _, err := tx.OriginalOutput(prevout) if err != nil { return err } @@ -88,7 +88,7 @@ func (view *UtxoViewpoint) DetachTransaction(tx *bc.Tx) error { } for _, id := range tx.TxHeader.ResultIds { - _, err := tx.Output(*id) + _, err := tx.OriginalOutput(*id) if err != nil { // error due to it's a retirement, utxo doesn't care this output type so skip it continue