mirror of
https://github.com/kaspanet/kaspad.git
synced 2025-06-09 15:46:43 +00:00

* [NOD-1098] Change timestamps to be millisecond precision * [NOD-1098] Change lock times to use milliseconds * [NOD-1098] Use milliseconds precision everywhere * [NOD-1098] Implement type mstime.Time * [NOD-1098] Fix block 100000 timestamp * [NOD-1098] Change orphan child to be one millisecond delay after its parent * [NOD-1098] Remove test that checks if header timestamps have the right precision, and instead add tests for mstime, and fix genesis for testnet and devnet * [NOD-1098] Fix comment * [NOD-1098] Fix comment * [NOD-1098] Fix testnet genesis * [NOD-1098] Rename UnixMilli->UnixMilliseconds
33 lines
715 B
Go
33 lines
715 B
Go
package rpc
|
|
|
|
import (
|
|
"github.com/kaspanet/kaspad/rpcmodel"
|
|
"github.com/kaspanet/kaspad/util/daghash"
|
|
)
|
|
|
|
func handleGetMempoolEntry(s *Server, cmd interface{}, closeChan <-chan struct{}) (interface{}, error) {
|
|
c := cmd.(*rpcmodel.GetMempoolEntryCmd)
|
|
txID, err := daghash.NewTxIDFromStr(c.TxID)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
txDesc, err := s.cfg.TxMemPool.FetchTxDesc(txID)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
tx := txDesc.Tx
|
|
rawTx, err := createTxRawResult(s.cfg.DAGParams, tx.MsgTx(), tx.ID().String(),
|
|
nil, "", nil, true)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
return &rpcmodel.GetMempoolEntryResult{
|
|
Fee: txDesc.Fee,
|
|
Time: txDesc.Added.UnixMilliseconds(),
|
|
RawTx: *rawTx,
|
|
}, nil
|
|
}
|