NewState returns a new State bound to strg.
(level sql.IsolationLevel, nodeID proto.NodeID, strg xi.Storage)
| 70 | |
| 71 | // NewState returns a new State bound to strg. |
| 72 | func NewState(level sql.IsolationLevel, nodeID proto.NodeID, strg xi.Storage) (s *State) { |
| 73 | s = &State{ |
| 74 | level: level, |
| 75 | nodeID: nodeID, |
| 76 | strg: strg, |
| 77 | pool: newPool(), |
| 78 | maxTx: 100, |
| 79 | } |
| 80 | s.openHandler() |
| 81 | return |
| 82 | } |
| 83 | |
| 84 | func (s *State) openHandler() { |
| 85 | if s.level == sql.LevelReadUncommitted { |