@@ -385,9 +385,7 @@ impl<A: Clone + Ord> TxGraph<A> {
385
385
0 ,
386
386
) ,
387
387
) ;
388
- let changeset = self . determine_changeset ( update) ;
389
- self . apply_changeset ( changeset. clone ( ) ) ;
390
- changeset
388
+ self . apply_update ( update)
391
389
}
392
390
393
391
/// Inserts the given transaction into [`TxGraph`].
@@ -398,9 +396,7 @@ impl<A: Clone + Ord> TxGraph<A> {
398
396
update
399
397
. txs
400
398
. insert ( tx. txid ( ) , ( TxNodeInternal :: Whole ( tx) , BTreeSet :: new ( ) , 0 ) ) ;
401
- let changeset = self . determine_changeset ( update) ;
402
- self . apply_changeset ( changeset. clone ( ) ) ;
403
- changeset
399
+ self . apply_update ( update)
404
400
}
405
401
406
402
/// Inserts the given `anchor` into [`TxGraph`].
@@ -410,9 +406,7 @@ impl<A: Clone + Ord> TxGraph<A> {
410
406
pub fn insert_anchor ( & mut self , txid : Txid , anchor : A ) -> ChangeSet < A > {
411
407
let mut update = Self :: default ( ) ;
412
408
update. anchors . insert ( ( anchor, txid) ) ;
413
- let changeset = self . determine_changeset ( update) ;
414
- self . apply_changeset ( changeset. clone ( ) ) ;
415
- changeset
409
+ self . apply_update ( update)
416
410
}
417
411
418
412
/// Inserts the given `seen_at` for `txid` into [`TxGraph`].
@@ -422,9 +416,7 @@ impl<A: Clone + Ord> TxGraph<A> {
422
416
let mut update = Self :: default ( ) ;
423
417
let ( _, _, update_last_seen) = update. txs . entry ( txid) . or_default ( ) ;
424
418
* update_last_seen = seen_at;
425
- let changeset = self . determine_changeset ( update) ;
426
- self . apply_changeset ( changeset. clone ( ) ) ;
427
- changeset
419
+ self . apply_update ( update)
428
420
}
429
421
430
422
/// Extends this graph with another so that `self` becomes the union of the two sets of
0 commit comments