chore(mempool): remove implementation of get pool transaction
This commit is contained in:
parent
eec3966c76
commit
b98672fd56
|
@ -29,10 +29,6 @@ type MemPool interface {
|
|||
|
||||
GetTimeoutTransactions(rebroadcastDuration time.Duration) [][]pb.Transaction
|
||||
|
||||
GetPendingTransactions(max int) []pb.Transaction
|
||||
|
||||
GetTransaction(hash *types.Hash) pb.Transaction
|
||||
|
||||
SubscribeTxEvent(chan<- events.NewTxsEvent) event.Subscription
|
||||
|
||||
External
|
||||
|
@ -44,6 +40,10 @@ type External interface {
|
|||
// GetPendingNonceByAccount will return the latest pending nonce of a given account
|
||||
GetPendingNonceByAccount(account string) uint64
|
||||
|
||||
GetPendingTransactions(max int) []pb.Transaction
|
||||
|
||||
GetTransaction(hash *types.Hash) pb.Transaction
|
||||
|
||||
// IsPoolFull check if memPool has exceeded the limited txSize.
|
||||
IsPoolFull() bool
|
||||
}
|
||||
|
|
|
@ -327,22 +327,24 @@ func (mpi *mempoolImpl) GetPendingTransactions(max int) []pb.Transaction {
|
|||
}
|
||||
|
||||
func (mpi *mempoolImpl) GetTransaction(hash *types.Hash) pb.Transaction {
|
||||
key, ok := mpi.txStore.txHashMap[hash.String()]
|
||||
if !ok {
|
||||
return nil
|
||||
}
|
||||
// TODO: make it go routine safe
|
||||
//key, ok := mpi.txStore.txHashMap[hash.String()]
|
||||
//if !ok {
|
||||
// return nil
|
||||
//}
|
||||
//
|
||||
//txMap, ok := mpi.txStore.allTxs[key.account]
|
||||
//if !ok {
|
||||
// return nil
|
||||
//}
|
||||
//
|
||||
//item, ok := txMap.items[key.nonce]
|
||||
//if !ok {
|
||||
// return nil
|
||||
//}
|
||||
|
||||
txMap, ok := mpi.txStore.allTxs[key.account]
|
||||
if !ok {
|
||||
return nil
|
||||
}
|
||||
|
||||
item, ok := txMap.items[key.nonce]
|
||||
if !ok {
|
||||
return nil
|
||||
}
|
||||
|
||||
return item.tx
|
||||
//return item.tx
|
||||
return nil
|
||||
}
|
||||
|
||||
func (mpi *mempoolImpl) shardTxList(timeoutItems []*orderedTimeoutKey, batchLen uint64) [][]pb.Transaction {
|
||||
|
|
Loading…
Reference in New Issue