@@ -90,14 +90,36 @@ where
90
90
91
91
/// Apply an `update` directly.
92
92
///
93
- /// `update` is a [`TxGraph<A>`] and the resultant changes is returned as [`ChangeSet`].
94
- pub fn apply_update ( & mut self , update : TxGraph < A > ) -> ChangeSet < A , I :: ChangeSet > {
95
- let graph = self . graph . apply_update ( update) ;
96
- let indexer = self . index_tx_graph_changeset ( & graph) ;
97
- ChangeSet {
98
- tx_graph : graph,
99
- indexer,
100
- }
93
+ /// `update` is a [`tx_graph::Update<A>`] and the resultant changes is returned as [`ChangeSet`].
94
+ #[ cfg( feature = "std" ) ]
95
+ #[ cfg_attr( docsrs, doc( cfg( feature = "std" ) ) ) ]
96
+ pub fn apply_update ( & mut self , update : tx_graph:: Update < A > ) -> ChangeSet < A , I :: ChangeSet > {
97
+ let tx_graph = self . graph . apply_update ( update) ;
98
+ let indexer = self . index_tx_graph_changeset ( & tx_graph) ;
99
+ ChangeSet { tx_graph, indexer }
100
+ }
101
+
102
+ /// Apply the given `update` with an optional `seen_at` timestamp.
103
+ ///
104
+ /// `seen_at` represents when the update is seen (in unix seconds). It is used to determine the
105
+ /// `last_seen`s for all transactions in the update which have no corresponding anchor(s). The
106
+ /// `last_seen` value is used internally to determine precedence of conflicting unconfirmed
107
+ /// transactions (where the transaction with the lower `last_seen` value is omitted from the
108
+ /// canonical history).
109
+ ///
110
+ /// Not setting a `seen_at` value means unconfirmed transactions introduced by this update will
111
+ /// not be part of the canonical history of transactions.
112
+ ///
113
+ /// Use [`apply_update`](IndexedTxGraph::apply_update) to have the `seen_at` value automatically
114
+ /// set to the current time.
115
+ pub fn apply_update_at (
116
+ & mut self ,
117
+ update : tx_graph:: Update < A > ,
118
+ seen_at : Option < u64 > ,
119
+ ) -> ChangeSet < A , I :: ChangeSet > {
120
+ let tx_graph = self . graph . apply_update_at ( update, seen_at) ;
121
+ let indexer = self . index_tx_graph_changeset ( & tx_graph) ;
122
+ ChangeSet { tx_graph, indexer }
101
123
}
102
124
103
125
/// Insert a floating `txout` of given `outpoint`.
0 commit comments