Comments (4)
This commit should fix the problem... waiting for someone with such gateway to test.
from nbitcoin.
Close it. It worked (it opens the port with lifetime=0).
However, running the ProtocolTest.CanUseUpnp() test, I can see it fails in another place (see the screenshot). That is because the test asserts that lease.IsOpen before Device is assigned. The defect was there before but now that it takes a little more time to open the port, it fails.
Here you have the evidence it is working now.
Another thing to have in mind is AddPortMapping operation can fail for 4 different reasons:
Here you can see what I am talking about. This is part of Open.NAT (not released yet)
catch(MappingException me)
{
switch (me.ErrorCode)
{
case UpnpConstants.OnlyPermanentLeasesSupported:
NatUtility.TraceSource.LogWarn("Only Permanent Leases Supported - There is no warranty it will be closed");
mapping.Lifetime = 0;
break;
case UpnpConstants.SamePortValuesRequired:
NatUtility.TraceSource.LogWarn("Same Port Values Required - Using internal port {0}", mapping.PrivatePort);
mapping.PublicPort = mapping.PrivatePort;
break;
case UpnpConstants.RemoteHostOnlySupportsWildcard:
NatUtility.TraceSource.LogWarn("Remote Host Only Supports Wildcard");
mapping.PublicIP = IPAddress.None;
break;
case UpnpConstants.ExternalPortOnlySupportsWildcard:
NatUtility.TraceSource.LogWarn("External Port Only Supports Wildcard");
break;
}
message = new CreatePortMappingRequestMessage(mapping);
_soapClient
.InvokeAsync("AddPortMapping", message.ToXml())
.TimeoutAfter(TimeSpan.FromSeconds(3));
RegisterMapping(mapping);
}
from nbitcoin.
I indeed, added a bug because of the last changes, I just fixed it.
Can you try again ? if it works, I close the issue.
I am not sure how to handle these exception in UPnPLease.
I think, the current situation for these other case is fine (DetectExternalEndpoint will return false, and so the NodeServer will use external web service to deduce external ip instead)
Same ports are tried before anything else.
from nbitcoin.
Works okey.
from nbitcoin.
Related Issues (20)
- HexEncoder fails to decode valid encoded string HOT 2
- Get new Key object from a BitInteger HOT 1
- multisig partially signed transaction example
- How to generate a Nostr keypair HOT 2
- Too small max transaction size HOT 2
- calling GetAddress() with ScriptPubKeyType.TaprootBIP86 generates incorrect address? HOT 3
- Support for `wtxidrelay` message
- `Array size too big` after receiving block containing Ordinal NFT HOT 6
- Need some code example on how to use RPC client on Bitcoin Test net. HOT 10
- Why test code not working for using NbitcoinTest? HOT 3
- How to find the peers in BTC blockchain? HOT 2
- Add bitcoin as a topic to this repository
- No call to TransactionBuilder.Send has been done which can support the fees HOT 1
- Link on the github readme page to ebook is not working
- Non-segwit inputs are not serialized in PSBTs HOT 4
- VerifyMessage does not exist HOT 7
- Hello, is there any sample code for taproot? HOT 1
- How to generate taproot NOMS internal key?
- Unable to create or compile to get NBitcoin.dll
- "Unknown transaction optional data" error when calling GetBlock() HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nbitcoin.