remove timew over transaction hashes
()
| 107 | |
| 108 | //remove timew over transaction hashes |
| 109 | func (self *Session) RemoveTimeoverTxHashes() (remove []TxHashInfo) { |
| 110 | self.Lock() |
| 111 | defer self.Unlock() |
| 112 | index := len(self.TxHashArr) |
| 113 | now := time.Now().Unix() |
| 114 | for k, v := range self.TxHashArr { |
| 115 | if (now - v.StartTime) < int64(cfg.DEFAULT_GEN_BLOCK_TIME*10) { |
| 116 | index = k |
| 117 | break |
| 118 | } |
| 119 | } |
| 120 | remove = self.TxHashArr[0:index] |
| 121 | self.TxHashArr = self.TxHashArr[index:] |
| 122 | return remove |
| 123 | } |
| 124 | |
| 125 | //append transaction hash |
| 126 | func (self *Session) AppendTxHash(txhash string) { |