(tx *types.Transaction, height uint32)
| 161 | } |
| 162 | |
| 163 | func (self *Store) saveTransaction(tx *types.Transaction, height uint32) error { |
| 164 | // generate key with DATA_TRANSACTION prefix |
| 165 | key := GenDataTransactionKey(tx.Hash()) |
| 166 | defer keyPool.Put(key) |
| 167 | |
| 168 | value := common.NewZeroCopySink(nil) |
| 169 | value.WriteUint32(height) |
| 170 | tx.Serialization(value) |
| 171 | |
| 172 | // put value |
| 173 | self.db.BatchPut(key.Bytes(), value.Bytes()) |
| 174 | return nil |
| 175 | } |
| 176 | |
| 177 | func (self *Store) PersistBlock(block *types.Block) error { |
| 178 | height := block.Header.Height |
no test coverage detected