[#TxGraph-AddDependency]
= xref:TxGraph.adoc[TxGraph]::AddDependency
:relfileprefix: ../
:mrdocs:

Add a dependency between two specified transactions&period; If a staging graph exists, the dependency is only added there&period; Parent may not be a descendant of child already (but may be an ancestor of it already, in which case this is a no&hyphen;op)&period; If either transaction is already removed, this is a no&hyphen;op&period;

== Synopsis

Declared in `&lt;txgraph&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
virtual
void
AddDependency(
    xref:TxGraph/Ref.adoc[Ref] const& parent,
    xref:TxGraph/Ref.adoc[Ref] const& child) noexcept = 0;
----

== Parameters

[cols="1,4"]
|===
| Name| Description
| *parent*
| Reference to the parent (spent&hyphen;from) transaction&period;
| *child*
| Reference to the child (spending) transaction&period;
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
