Compare commits

..

4 commits

Author SHA1 Message Date
Ava Chow
d6d6ae91fa
Merge 352391c2cf into 433412fd84 2025-01-07 21:16:51 +01:00
Antoine Poinsot
352391c2cf qa: check parsed multipath descriptors dont share references 2025-01-07 15:16:38 -05:00
Ava Chow
8d12b59951 miniscript: Make NodeRef a unique_ptr
There's no need for it to be a shared_ptr.
2025-01-07 15:16:38 -05:00
Ava Chow
3f10ee4fc4 miniscript: Ensure there is no NodeRef copy constructor or assignment operator 2025-01-07 15:16:38 -05:00

View file

@ -191,7 +191,7 @@ using Opcode = std::pair<opcodetype, std::vector<unsigned char>>;
template<typename Key> struct Node;
template<typename Key> using NodeRef = std::unique_ptr<const Node<Key>>;
//! Construct a miniscript node as a shared_ptr.
//! Construct a miniscript node as a unique_ptr.
template<typename Key, typename... Args>
NodeRef<Key> MakeNodeRef(Args&&... args) { return std::make_unique<const Node<Key>>(std::forward<Args>(args)...); }
@ -1693,7 +1693,7 @@ public:
template <typename Ctx> Node(const Ctx& ctx, Fragment nt, uint32_t val = 0)
: Node(internal::NoDupCheck{}, ctx.MsContext(), nt, val) { DuplicateKeyCheck(ctx); }
// Delete copy constructor and assignment operator
// Delete copy constructor and assignment operator, use Clone() instead
Node(const Node&) = delete;
Node& operator=(const Node&) = delete;
};