MCPcopy Create free account
hub / github.com/ElementsProject/elements / Merge

Method Merge

src/script/standard.cpp:392–411  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

390}
391
392void TaprootSpendData::Merge(TaprootSpendData other)
393{
394 // TODO: figure out how to better deal with conflicting information
395 // being merged.
396 if (internal_key.IsNull() && !other.internal_key.IsNull()) {
397 internal_key = other.internal_key;
398 }
399 if (merkle_root.IsNull() && !other.merkle_root.IsNull()) {
400 merkle_root = other.merkle_root;
401 }
402 for (auto& [key, control_blocks] : other.scripts) {
403 // Once P0083R3 is supported by all our targeted platforms,
404 // this loop body can be replaced with:
405 // scripts[key].merge(std::move(control_blocks));
406 auto& target = scripts[key];
407 for (auto& control_block: control_blocks) {
408 target.insert(std::move(control_block));
409 }
410 }
411}
412
413void TaprootBuilder::Insert(TaprootBuilder::NodeInfo&& node, int depth)
414{

Callers 6

MakeScriptsMethod · 0.45
MergeFunction · 0.45
SignTaprootFunction · 0.45
BOOST_AUTO_TEST_CASEFunction · 0.45
FUZZ_TARGETFunction · 0.45
FUZZ_TARGET_INITFunction · 0.45

Calls 2

IsNullMethod · 0.45
insertMethod · 0.45

Tested by 3

BOOST_AUTO_TEST_CASEFunction · 0.36
FUZZ_TARGETFunction · 0.36
FUZZ_TARGET_INITFunction · 0.36