graphdb: pass context to PruneTip

This commit is contained in:
Elle Mouton committed 2026-02-25 16:11:46 +02:00
1 parent 9f855175d5
commit a31c86b0ee
6 files changed
+16 -11

No files matched your search

+5 -3
View File
@@ -175,7 +175,7 @@ func (b *Builder) Start() error {
// If the graph has never been pruned, or hasn't fully been created yet,
// then we don't treat this as an explicit error.
if _, _, err := b.cfg.Graph.PruneTip(); err != nil {
if _, _, err := b.cfg.Graph.PruneTip(context.TODO()); err != nil {
switch {
case errors.Is(err, graphdb.ErrGraphNeverPruned):
fallthrough
@@ -324,7 +324,7 @@ func (b *Builder) syncGraphWithChain() error {
}
b.bestHeight.Store(uint32(bestHeight))
pruneHash, pruneHeight, err := b.cfg.Graph.PruneTip()
pruneHash, pruneHeight, err := b.cfg.Graph.PruneTip(context.TODO())
if err != nil {
switch {
// If the graph has never been pruned, or hasn't fully been
@@ -371,7 +371,9 @@ func (b *Builder) syncGraphWithChain() error {
return err
}
pruneHash, pruneHeight, err = b.cfg.Graph.PruneTip()
pruneHash, pruneHeight, err = b.cfg.Graph.PruneTip(
context.TODO(),
)
switch {
// If at this point the graph has never been pruned, we can exit
// as this entails we are back to the point where it hasn't seen