Skip to content

Commit

Permalink
contract: preserve historic state for reorgs and unmined witness txes
Browse files Browse the repository at this point in the history
  • Loading branch information
dr-orlovsky committed Jul 8, 2023
1 parent 54e7cbb commit 23706b5
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/contract/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,10 @@ impl ContractHistory {
}
}

// We skip removing of invalidated state for the cases of re-orgs or unmined witness
// transactions committing to the new state.
// TODO: Expose an API to prune historic state by witness txid
/*
// Remove invalidated state
for input in &op.inputs() {
if let Some(o) = self.rights.iter().find(|r| r.opout == input.prev_out) {
Expand Down Expand Up @@ -411,6 +415,7 @@ impl ContractHistory {
.expect("collection allows zero elements");
}
}
*/

match op.assignments() {
AssignmentsRef::Genesis(assignments) => {
Expand Down

0 comments on commit 23706b5

Please sign in to comment.