forked from sociomantic-tsunami/swarm
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add methods to set AddrPort from NodeItem and convert back
As part of replacing internal usages of NodeItem with AddrPort, it's useful to have a convenient way of converting from one to the other. Part of sociomantic-tsunami#348.
- Loading branch information
Gavin Norman
committed
Aug 23, 2018
1 parent
e1fa67b
commit 2d6937e
Showing
2 changed files
with
54 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
### Methods to convert between `AddrPort` and `NodeItem` | ||
|
||
`swarm.neo.AddrPort` | ||
|
||
Swarm uses two address/port representations internally (for historical reasons). | ||
In the future, we will remove the old `NodeItem`, but for now it's useful to | ||
have convenient methods for converting back and forth. | ||
|
||
`AddrPort` now has the following new methods: | ||
* `typeof(this) set ( NodeItem node_item )` | ||
* `NodeItem asNodeItem ( ref mstring buf )` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters