OSDN Git Service

test: add utxo test for cross-chain tx (#72)
[bytom/vapor.git] / wallet / unconfirmed.go
index 0d8a17a..4eec6a2 100644 (file)
@@ -94,7 +94,7 @@ func (w *Wallet) RemoveUnconfirmedTx(txD *protocol.TxDesc) {
 func (w *Wallet) buildAnnotatedUnconfirmedTx(tx *types.Tx) *query.AnnotatedTx {
        annotatedTx := &query.AnnotatedTx{
                ID:        tx.ID,
-               Timestamp: uint64(time.Now().Unix()),
+               Timestamp: uint64(time.Now().UnixNano() / int64(time.Millisecond)),
                Inputs:    make([]*query.AnnotatedInput, 0, len(tx.Inputs)),
                Outputs:   make([]*query.AnnotatedOutput, 0, len(tx.Outputs)),
                Size:      tx.SerializedSize,
@@ -113,7 +113,7 @@ func (w *Wallet) buildAnnotatedUnconfirmedTx(tx *types.Tx) *query.AnnotatedTx {
 func (w *Wallet) checkRelatedTransaction(tx *types.Tx) bool {
        for _, v := range tx.Outputs {
                var hash [32]byte
-               sha3pool.Sum256(hash[:], v.ControlProgram)
+               sha3pool.Sum256(hash[:], v.ControlProgram())
                if bytes := w.DB.Get(account.ContractKey(hash)); bytes != nil {
                        return true
                }