Page MenuHomePhabricator

rpc: Avoid useless mempool query in gettxoutproof
ClosedPublic

Authored by PiRK on Wed, Jul 14, 07:55.

Details

Reviewers
Fabien
Group Reviewers
Restricted Project
Commits
rABCd23ae6f6ee5a: rpc: Avoid useless mempool query in gettxoutproof
Summary

GetTransaction implicitly and unconditionally asks the mempool global for a transaction. This is problematic for several reasons:

  • gettxoutproof is for on-chain txs only and asking the mempool for on-chain txs is confusing and minimally wasteful
  • Globals are confusing and make code harder to test with unit tests

Fix both issues by passing in an optional mempool. This also helps with core#19556

This is a backport of core#19589

Test Plan

ninja all check-all

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

PiRK requested review of this revision.Wed, Jul 14, 07:55

@bot build-master

src/validation.h
244 ↗(On Diff #29174)

txid

hash -> txid in GetTransaction function documentation

This revision is now accepted and ready to land.Thu, Jul 15, 09:35
This revision was landed with ongoing or failed builds.Thu, Jul 15, 09:48
This revision was automatically updated to reflect the committed changes.