Commit 12daf6f
committed
walletdb: scope bdb::EraseRecords under a single db txn
so we erase all the records atomically or abort the entire
procedure.
and, at the same time, we can share the same db txn context
for the db cursor and the erase functionality.
extra note from the Db.cursor doc:
"If transaction protection is enabled, cursors must be
opened and closed within the context of a transaction"
thus why added a `CloseCursor` call before calling to
`TxnAbort/TxnCommit`.1 parent 043fcb0 commit 12daf6f
1 file changed
+14
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1136 | 1136 | | |
1137 | 1137 | | |
1138 | 1138 | | |
| 1139 | + | |
| 1140 | + | |
| 1141 | + | |
1139 | 1142 | | |
1140 | 1143 | | |
1141 | 1144 | | |
| |||
1144 | 1147 | | |
1145 | 1148 | | |
1146 | 1149 | | |
1147 | | - | |
1148 | | - | |
| 1150 | + | |
1149 | 1151 | | |
1150 | 1152 | | |
1151 | 1153 | | |
1152 | 1154 | | |
1153 | 1155 | | |
1154 | 1156 | | |
1155 | 1157 | | |
| 1158 | + | |
| 1159 | + | |
1156 | 1160 | | |
1157 | 1161 | | |
1158 | 1162 | | |
| |||
1163 | 1167 | | |
1164 | 1168 | | |
1165 | 1169 | | |
1166 | | - | |
| 1170 | + | |
| 1171 | + | |
| 1172 | + | |
| 1173 | + | |
| 1174 | + | |
1167 | 1175 | | |
1168 | 1176 | | |
1169 | | - | |
| 1177 | + | |
| 1178 | + | |
| 1179 | + | |
1170 | 1180 | | |
1171 | 1181 | | |
1172 | 1182 | | |
| |||
0 commit comments