--- a/src/node/address.cc Wed Aug 01 08:58:18 2007 +0200
+++ b/src/node/address.cc Wed Aug 01 09:01:54 2007 +0200
@@ -40,6 +40,12 @@
return *this;
}
+bool
+Address::IsInvalid (void) const
+{
+ return m_len == 0 && m_type == 0;
+}
+
uint8_t
Address::GetLength (void) const
{
--- a/src/node/address.h Wed Aug 01 08:58:18 2007 +0200
+++ b/src/node/address.h Wed Aug 01 09:01:54 2007 +0200
@@ -87,6 +87,14 @@
Address &operator = (const Address &address);
/**
+ * \returns true if this address is invalid, false otherwise.
+ *
+ * An address is invalid if and only if it was created
+ * through the default constructor and it was never
+ * re-initialized.
+ */
+ bool IsInvalid (void);
+ /**
* \returns the length of the underlying address.
*/
uint8_t GetLength (void) const;