-
Notifications
You must be signed in to change notification settings - Fork 100
Description
What is your feature request?
Add a GRPC method:
message OutPoint {
bytes txid = 1; // transaction identifier
uint32 output_index = 2; // index of the output in the transactions `vout` array
}
rpc GetSpendingTx(OutPoint) returns (RawTransaction) {}
where GetSpendingTx returns the transaction that spends the provided output, or NotFound if the outpoint is not recognized or the outpoint is unspent.
How would this feature help you?
In restoring transparent history, it is possible to traverse the transaction graph from spending tx to source of funds using available methods of the GRPC interface, but there is no direct way to find the transaction that spends a given output. As a consequence, it's currently necessary to use the GetTaddressTxids method to attempt to find spends related to a given outpoint, but this is highly imprecise - it will return all of the transactions that involve that address, and queries to this method must specify a block range to query. In highly active wallets, this could result in numerous calls that each return hundreds or thousands of results, rather than just the one result that is wanted.
Adding this RPC method will make it possible to fully restore a wallet's transparent transaction graph in an efficient manner.