"github.com/bytom/errors"
"github.com/bytom/protocol"
"github.com/bytom/protocol/bc"
- "github.com/bytom/protocol/bc/legacy"
+ "github.com/bytom/protocol/bc/types"
"github.com/bytom/protocol/vm/vmutil"
)
DB dbm.DB
TxFeeds []*TxFeed
chain *protocol.Chain
- txfeedCh chan *legacy.Tx
+ txfeedCh chan *types.Tx
}
type rawOutput struct {
DB: db,
TxFeeds: make([]*TxFeed, 0, 10),
chain: chain,
- txfeedCh: make(chan *legacy.Tx, maxNewTxfeedChSize),
+ txfeedCh: make(chan *types.Tx, maxNewTxfeedChSize),
}
return s
}
//GetTxfeedCh return a txfeed channel.
-func (t *Tracker) GetTxfeedCh() chan *legacy.Tx {
+func (t *Tracker) GetTxfeedCh() chan *types.Tx {
return t.txfeedCh
}
}
//TxFilter filter tx from mempool.
-func (t *Tracker) TxFilter(tx *legacy.Tx) error {
+func (t *Tracker) TxFilter(tx *types.Tx) error {
var annotatedTx *query.AnnotatedTx
// Build the fully annotated transaction.
annotatedTx = buildAnnotatedTransaction(tx)
var emptyJSONObject = chainjson.HexBytes(`{}`)
-func buildAnnotatedTransaction(orig *legacy.Tx) *query.AnnotatedTx {
+func buildAnnotatedTransaction(orig *types.Tx) *query.AnnotatedTx {
tx := &query.AnnotatedTx{
ID: orig.ID,
Inputs: make([]*query.AnnotatedInput, 0, len(orig.Inputs)),
return tx
}
-func buildAnnotatedInput(tx *legacy.Tx, i uint32) *query.AnnotatedInput {
+func buildAnnotatedInput(tx *types.Tx, i uint32) *query.AnnotatedInput {
orig := tx.Inputs[i]
in := &query.AnnotatedInput{
AssetID: orig.AssetID(),
return in
}
-func buildAnnotatedOutput(tx *legacy.Tx, idx int) *query.AnnotatedOutput {
+func buildAnnotatedOutput(tx *types.Tx, idx int) *query.AnnotatedOutput {
orig := tx.Outputs[idx]
outid := tx.OutputID(idx)
out := &query.AnnotatedOutput{