Skip to content
This repository has been archived by the owner on Apr 2, 2024. It is now read-only.

Commit

Permalink
Merge pull request #538 from BuxOrg/fix-474-prevent-panics
Browse files Browse the repository at this point in the history
fix(BUX-474): prevent panics in UnReserveUtxos and VerifyMerkleRoots
  • Loading branch information
chris-4chain authored Jan 16, 2024
2 parents ba7bb1b + 3919f38 commit cf44cd7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion action_utxo.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ func (c *Client) UnReserveUtxos(ctx context.Context, xPubID, draftID string) err
// Check for existing NewRelic transaction
ctx = c.GetOrStartTxn(ctx, "unreserve_uxtos_by_draft_id")

return unReserveUtxos(ctx, xPubID, draftID)
return unReserveUtxos(ctx, xPubID, draftID, c.DefaultModelOptions()...)
}

// should this be optional in the results?
Expand Down
4 changes: 4 additions & 0 deletions chainstate/merkle_root.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ import (

// VerifyMerkleRoots will try to verify merkle roots with all available providers
func (c *Client) VerifyMerkleRoots(ctx context.Context, merkleRoots []MerkleRootConfirmationRequestItem) error {
if c.options.config.pulseClient == nil {
c.options.logger.Warn().Msg("VerifyMerkleRoots is called even though no pulse client is configured; this likely indicates that the paymail capabilities have been cached.")
return errors.New("no pulse client found")
}
pulseProvider := createPulseProvider(c)
merkleRootsRes, err := pulseProvider.verifyMerkleRoots(ctx, c, merkleRoots)
if err != nil {
Expand Down

0 comments on commit cf44cd7

Please sign in to comment.