multi: fix various typos in comments
This commit is contained in:
parent
dcd8190c80
commit
ac24b12bf2
@ -419,7 +419,7 @@ func (b *breachArbiter) waitForSpendEvent(breachInfo *retributionInfo,
|
|||||||
// We'll wait for any of the outputs to be spent, or that we are
|
// We'll wait for any of the outputs to be spent, or that we are
|
||||||
// signalled to exit.
|
// signalled to exit.
|
||||||
select {
|
select {
|
||||||
// A goroutine have signalled that a spend occured.
|
// A goroutine have signalled that a spend occurred.
|
||||||
case <-anySpend:
|
case <-anySpend:
|
||||||
// Signal for the remaining goroutines to exit.
|
// Signal for the remaining goroutines to exit.
|
||||||
close(exit)
|
close(exit)
|
||||||
|
@ -497,7 +497,7 @@ func (b *BitcoindNotifier) confDetailsFromTxIndex(txid *chainhash.Hash,
|
|||||||
// then we may be able to dispatch it immediately.
|
// then we may be able to dispatch it immediately.
|
||||||
tx, err := b.chainConn.GetRawTransactionVerbose(txid)
|
tx, err := b.chainConn.GetRawTransactionVerbose(txid)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
// If the transaction lookup was succesful, but it wasn't found
|
// If the transaction lookup was successful, but it wasn't found
|
||||||
// within the index itself, then we can exit early. We'll also
|
// within the index itself, then we can exit early. We'll also
|
||||||
// need to look at the error message returned as the error code
|
// need to look at the error message returned as the error code
|
||||||
// is used for multiple errors.
|
// is used for multiple errors.
|
||||||
|
@ -566,7 +566,7 @@ func (b *BtcdNotifier) confDetailsFromTxIndex(txid *chainhash.Hash,
|
|||||||
// then we may be able to dispatch it immediately.
|
// then we may be able to dispatch it immediately.
|
||||||
tx, err := b.chainConn.GetRawTransactionVerbose(txid)
|
tx, err := b.chainConn.GetRawTransactionVerbose(txid)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
// If the transaction lookup was succesful, but it wasn't found
|
// If the transaction lookup was successful, but it wasn't found
|
||||||
// within the index itself, then we can exit early. We'll also
|
// within the index itself, then we can exit early. We'll also
|
||||||
// need to look at the error message returned as the error code
|
// need to look at the error message returned as the error code
|
||||||
// is used for multiple errors.
|
// is used for multiple errors.
|
||||||
|
@ -211,7 +211,7 @@ func (tcn *TxConfNotifier) UpdateConfDetails(txid chainhash.Hash,
|
|||||||
ntfn.details = details
|
ntfn.details = details
|
||||||
|
|
||||||
// Now, we'll examine whether the transaction of this notification
|
// Now, we'll examine whether the transaction of this notification
|
||||||
// request has reched its required number of confirmations. If it has,
|
// request has reached its required number of confirmations. If it has,
|
||||||
// we'll disaptch a confirmation notification to the caller.
|
// we'll disaptch a confirmation notification to the caller.
|
||||||
confHeight := details.BlockHeight + ntfn.NumConfirmations - 1
|
confHeight := details.BlockHeight + ntfn.NumConfirmations - 1
|
||||||
if confHeight <= tcn.currentHeight {
|
if confHeight <= tcn.currentHeight {
|
||||||
|
@ -416,7 +416,7 @@ func (d *DB) FetchWaitingCloseChannels() ([]*OpenChannel, error) {
|
|||||||
// fetchChannels attempts to retrieve channels currently stored in the
|
// fetchChannels attempts to retrieve channels currently stored in the
|
||||||
// database. The pending parameter determines whether only pending channels
|
// database. The pending parameter determines whether only pending channels
|
||||||
// will be returned, or only open channels will be returned. The waitingClose
|
// will be returned, or only open channels will be returned. The waitingClose
|
||||||
// parameter determines wheter only channels waiting for a closing transaction
|
// parameter determines whether only channels waiting for a closing transaction
|
||||||
// to be confirmed should be returned. If no active channels exist within the
|
// to be confirmed should be returned. If no active channels exist within the
|
||||||
// network, then ErrNoActiveChannels is returned.
|
// network, then ErrNoActiveChannels is returned.
|
||||||
func fetchChannels(d *DB, pending, waitingClose bool) ([]*OpenChannel, error) {
|
func fetchChannels(d *DB, pending, waitingClose bool) ([]*OpenChannel, error) {
|
||||||
|
@ -1549,7 +1549,7 @@ func TestNodeUpdatesInHorizon(t *testing.T) {
|
|||||||
len(nodeUpdates))
|
len(nodeUpdates))
|
||||||
}
|
}
|
||||||
|
|
||||||
// We'll create 10 node announcements, each with an update timestmap 10
|
// We'll create 10 node announcements, each with an update timestamp 10
|
||||||
// seconds after the other.
|
// seconds after the other.
|
||||||
const numNodes = 10
|
const numNodes = 10
|
||||||
nodeAnns := make([]LightningNode, 0, numNodes)
|
nodeAnns := make([]LightningNode, 0, numNodes)
|
||||||
|
@ -264,7 +264,7 @@ func (c *ChannelArbitrator) Start() error {
|
|||||||
|
|
||||||
// If the channel has been marked pending close in the database, and we
|
// If the channel has been marked pending close in the database, and we
|
||||||
// haven't transitioned the state machine to StateContractClosed (or a
|
// haven't transitioned the state machine to StateContractClosed (or a
|
||||||
// suceeding state), then a state transition most likely failed. We'll
|
// succeeding state), then a state transition most likely failed. We'll
|
||||||
// try to recover from this by manually advancing the state by setting
|
// try to recover from this by manually advancing the state by setting
|
||||||
// the corresponding close trigger.
|
// the corresponding close trigger.
|
||||||
trigger := chainTrigger
|
trigger := chainTrigger
|
||||||
@ -1530,7 +1530,7 @@ func (c *ChannelArbitrator) channelAttendant(bestHeight int32) {
|
|||||||
// logged, we can safely close the channel. After this
|
// logged, we can safely close the channel. After this
|
||||||
// succeeds we won't be getting chain events anymore,
|
// succeeds we won't be getting chain events anymore,
|
||||||
// so we must make sure we can recover on restart after
|
// so we must make sure we can recover on restart after
|
||||||
// it is marked closed. If the next state transation
|
// it is marked closed. If the next state transition
|
||||||
// fails, we'll start up in the prior state again, and
|
// fails, we'll start up in the prior state again, and
|
||||||
// we won't be longer getting chain events. In this
|
// we won't be longer getting chain events. In this
|
||||||
// case we must manually re-trigger the state
|
// case we must manually re-trigger the state
|
||||||
@ -1593,7 +1593,7 @@ func (c *ChannelArbitrator) channelAttendant(bestHeight int32) {
|
|||||||
// logged, we can safely close the channel. After this
|
// logged, we can safely close the channel. After this
|
||||||
// succeeds we won't be getting chain events anymore,
|
// succeeds we won't be getting chain events anymore,
|
||||||
// so we must make sure we can recover on restart after
|
// so we must make sure we can recover on restart after
|
||||||
// it is marked closed. If the next state transation
|
// it is marked closed. If the next state transition
|
||||||
// fails, we'll start up in the prior state again, and
|
// fails, we'll start up in the prior state again, and
|
||||||
// we won't be longer getting chain events. In this
|
// we won't be longer getting chain events. In this
|
||||||
// case we must manually re-trigger the state
|
// case we must manually re-trigger the state
|
||||||
|
@ -202,7 +202,7 @@ func TestGossipSyncerFilterGossipMsgsAllInMemory(t *testing.T) {
|
|||||||
// through the gossiper to the target peer. Our message will consist of
|
// through the gossiper to the target peer. Our message will consist of
|
||||||
// one node announcement above the horizon, one below. Additionally,
|
// one node announcement above the horizon, one below. Additionally,
|
||||||
// we'll include a chan ann with an update below the horizon, one
|
// we'll include a chan ann with an update below the horizon, one
|
||||||
// with an update timestmap above the horizon, and one without any
|
// with an update timestamp above the horizon, and one without any
|
||||||
// channel updates at all.
|
// channel updates at all.
|
||||||
msgs := []msgWithSenders{
|
msgs := []msgWithSenders{
|
||||||
{
|
{
|
||||||
|
@ -30,7 +30,7 @@ $ lnd --debuglevel=<subsystem>=<level>,<subsystem2>=<level>,...
|
|||||||
`lnd` has a built-in feature which allows you to capture profiling data at
|
`lnd` has a built-in feature which allows you to capture profiling data at
|
||||||
runtime using [pprof](https://golang.org/pkg/runtime/pprof/), a profiler for
|
runtime using [pprof](https://golang.org/pkg/runtime/pprof/), a profiler for
|
||||||
Go. The profiler has negligible performance overhead during normal operations
|
Go. The profiler has negligible performance overhead during normal operations
|
||||||
(unless you have explictly enabled CPU profiling).
|
(unless you have explicitly enabled CPU profiling).
|
||||||
|
|
||||||
To enable this ability, start `lnd` with the `--profile` option using a free port.
|
To enable this ability, start `lnd` with the `--profile` option using a free port.
|
||||||
|
|
||||||
|
@ -825,7 +825,7 @@ func assertAddedToRouterGraph(t *testing.T, alice, bob *testNode,
|
|||||||
// confirmed. The last arguments can be set if we expect the nodes to advertise
|
// confirmed. The last arguments can be set if we expect the nodes to advertise
|
||||||
// custom min_htlc values as part of their ChannelUpdate. We expect Alice to
|
// custom min_htlc values as part of their ChannelUpdate. We expect Alice to
|
||||||
// advertise the value required by Bob and vice versa. If they are not set the
|
// advertise the value required by Bob and vice versa. If they are not set the
|
||||||
// advertised value will be checked againts the other node's default min_htlc
|
// advertised value will be checked against the other node's default min_htlc
|
||||||
// value.
|
// value.
|
||||||
func assertChannelAnnouncements(t *testing.T, alice, bob *testNode,
|
func assertChannelAnnouncements(t *testing.T, alice, bob *testNode,
|
||||||
customMinHtlc ...lnwire.MilliSatoshi) {
|
customMinHtlc ...lnwire.MilliSatoshi) {
|
||||||
|
@ -88,7 +88,7 @@ func newPaymentCircuit(hash *[32]byte, pkt *htlcPacket) *PaymentCircuit {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// makePaymentCircuit initalizes a payment circuit on the stack using the
|
// makePaymentCircuit initializes a payment circuit on the stack using the
|
||||||
// payment hash and an in-memory htlc packet.
|
// payment hash and an in-memory htlc packet.
|
||||||
func makePaymentCircuit(hash *[32]byte, pkt *htlcPacket) PaymentCircuit {
|
func makePaymentCircuit(hash *[32]byte, pkt *htlcPacket) PaymentCircuit {
|
||||||
var addRef channeldb.AddRef
|
var addRef channeldb.AddRef
|
||||||
|
@ -2856,7 +2856,7 @@ func TestChannelLinkTrimCircuitsNoCommit(t *testing.T) {
|
|||||||
assertLinkBandwidth(t, alice.link, aliceStartingBandwidth)
|
assertLinkBandwidth(t, alice.link, aliceStartingBandwidth)
|
||||||
|
|
||||||
// Now, try to commit the last two payment circuits, which are unused
|
// Now, try to commit the last two payment circuits, which are unused
|
||||||
// thus far. These should succeed without hestiation.
|
// thus far. These should succeed without hesitation.
|
||||||
fwdActions = alice.commitCircuits(circuits[halfHtlcs:])
|
fwdActions = alice.commitCircuits(circuits[halfHtlcs:])
|
||||||
if len(fwdActions.Adds) != halfHtlcs {
|
if len(fwdActions.Adds) != halfHtlcs {
|
||||||
t.Fatalf("expected %d packets to be added", halfHtlcs)
|
t.Fatalf("expected %d packets to be added", halfHtlcs)
|
||||||
@ -4528,7 +4528,7 @@ func TestChannelLinkCleanupSpuriousResponses(t *testing.T) {
|
|||||||
// We start with he following scenario: Bob sends Alice two HTLCs, and a
|
// We start with he following scenario: Bob sends Alice two HTLCs, and a
|
||||||
// commitment dance ensures, leaving two HTLCs that Alice can respond
|
// commitment dance ensures, leaving two HTLCs that Alice can respond
|
||||||
// to. Since Alice is in ExitSettle mode, we will then take over and
|
// to. Since Alice is in ExitSettle mode, we will then take over and
|
||||||
// provide targetted fail messages to test the link's ability to cleanup
|
// provide targeted fail messages to test the link's ability to cleanup
|
||||||
// spurious responses.
|
// spurious responses.
|
||||||
//
|
//
|
||||||
// Bob Alice
|
// Bob Alice
|
||||||
|
12
lnd_test.go
12
lnd_test.go
@ -4492,7 +4492,7 @@ func testInvoiceRoutingHints(net *lntest.NetworkHarness, t *harnessTest) {
|
|||||||
timeout := time.Duration(15 * time.Second)
|
timeout := time.Duration(15 * time.Second)
|
||||||
const chanAmt = btcutil.Amount(100000)
|
const chanAmt = btcutil.Amount(100000)
|
||||||
|
|
||||||
// Throughout this test, we'll be opening a channel betwen Alice and
|
// Throughout this test, we'll be opening a channel between Alice and
|
||||||
// several other parties.
|
// several other parties.
|
||||||
//
|
//
|
||||||
// First, we'll create a private channel between Alice and Bob. This
|
// First, we'll create a private channel between Alice and Bob. This
|
||||||
@ -9523,7 +9523,7 @@ func testMultiHopHtlcLocalChainClaim(net *lntest.NetworkHarness, t *harnessTest)
|
|||||||
assertTxInBlock(t, block, commitHash)
|
assertTxInBlock(t, block, commitHash)
|
||||||
|
|
||||||
// After the force close transacion is mined, Carol should broadcast
|
// After the force close transacion is mined, Carol should broadcast
|
||||||
// her second level HTLC transacion. Bob will braodcast a sweep tx to
|
// her second level HTLC transacion. Bob will broadcast a sweep tx to
|
||||||
// sweep his output in the channel with Carol. He can do this
|
// sweep his output in the channel with Carol. He can do this
|
||||||
// immediately, as the output is not timelocked since Carol was the one
|
// immediately, as the output is not timelocked since Carol was the one
|
||||||
// force closing.
|
// force closing.
|
||||||
@ -9851,7 +9851,7 @@ func testMultiHopHtlcRemoteChainClaim(net *lntest.NetworkHarness, t *harnessTest
|
|||||||
assertTxInBlock(t, block, commitHash)
|
assertTxInBlock(t, block, commitHash)
|
||||||
|
|
||||||
// After the force close transacion is mined, Carol should broadcast
|
// After the force close transacion is mined, Carol should broadcast
|
||||||
// her second level HTLC transacion. Bob will braodcast a sweep tx to
|
// her second level HTLC transacion. Bob will broadcast a sweep tx to
|
||||||
// sweep his output in the channel with Carol. He can do this
|
// sweep his output in the channel with Carol. He can do this
|
||||||
// immediately, as the output is not timelocked since Carol was the one
|
// immediately, as the output is not timelocked since Carol was the one
|
||||||
// force closing.
|
// force closing.
|
||||||
@ -11473,7 +11473,7 @@ func testQueryRoutes(net *lntest.NetworkHarness, t *harnessTest) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// For all hops except the last, we check that fee equals feePerHop
|
// For all hops except the last, we check that fee equals feePerHop
|
||||||
// and amount to foward deducts feePerHop on each hop.
|
// and amount to forward deducts feePerHop on each hop.
|
||||||
expectedAmtToForwardMSat := expectedTotalAmtMSat
|
expectedAmtToForwardMSat := expectedTotalAmtMSat
|
||||||
for j, hop := range route.Hops[:len(route.Hops)-1] {
|
for j, hop := range route.Hops[:len(route.Hops)-1] {
|
||||||
expectedAmtToForwardMSat -= feePerHopMSat
|
expectedAmtToForwardMSat -= feePerHopMSat
|
||||||
@ -11499,7 +11499,7 @@ func testQueryRoutes(net *lntest.NetworkHarness, t *harnessTest) {
|
|||||||
i, j, expectedAmtToForwardMSat, hop.AmtToForwardMsat)
|
i, j, expectedAmtToForwardMSat, hop.AmtToForwardMsat)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Last hop should have zero fee and amount to foward should equal
|
// Last hop should have zero fee and amount to forward should equal
|
||||||
// payment amount.
|
// payment amount.
|
||||||
hop := route.Hops[len(route.Hops)-1]
|
hop := route.Hops[len(route.Hops)-1]
|
||||||
|
|
||||||
@ -11650,7 +11650,7 @@ func testRouteFeeCutoff(net *lntest.NetworkHarness, t *harnessTest) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// The payments should only be succesful across the route:
|
// The payments should only be successful across the route:
|
||||||
// Alice -> Bob -> Dave
|
// Alice -> Bob -> Dave
|
||||||
// Therefore, we'll update the fee policy on Carol's side for the
|
// Therefore, we'll update the fee policy on Carol's side for the
|
||||||
// channel between her and Dave to invalidate the route:
|
// channel between her and Dave to invalidate the route:
|
||||||
|
@ -404,7 +404,7 @@ func (*ChangePasswordResponse) Descriptor() ([]byte, []int) { return fileDescrip
|
|||||||
type Transaction struct {
|
type Transaction struct {
|
||||||
// / The transaction hash
|
// / The transaction hash
|
||||||
TxHash string `protobuf:"bytes,1,opt,name=tx_hash" json:"tx_hash,omitempty"`
|
TxHash string `protobuf:"bytes,1,opt,name=tx_hash" json:"tx_hash,omitempty"`
|
||||||
// / The transaction ammount, denominated in satoshis
|
// / The transaction amount, denominated in satoshis
|
||||||
Amount int64 `protobuf:"varint,2,opt,name=amount" json:"amount,omitempty"`
|
Amount int64 `protobuf:"varint,2,opt,name=amount" json:"amount,omitempty"`
|
||||||
// / The number of confirmations
|
// / The number of confirmations
|
||||||
NumConfirmations int32 `protobuf:"varint,3,opt,name=num_confirmations" json:"num_confirmations,omitempty"`
|
NumConfirmations int32 `protobuf:"varint,3,opt,name=num_confirmations" json:"num_confirmations,omitempty"`
|
||||||
|
@ -636,7 +636,7 @@ message Transaction {
|
|||||||
/// The transaction hash
|
/// The transaction hash
|
||||||
string tx_hash = 1 [ json_name = "tx_hash" ];
|
string tx_hash = 1 [ json_name = "tx_hash" ];
|
||||||
|
|
||||||
/// The transaction ammount, denominated in satoshis
|
/// The transaction amount, denominated in satoshis
|
||||||
int64 amount = 2 [ json_name = "amount" ];
|
int64 amount = 2 [ json_name = "amount" ];
|
||||||
|
|
||||||
/// The number of confirmations
|
/// The number of confirmations
|
||||||
|
@ -2672,7 +2672,7 @@
|
|||||||
"amount": {
|
"amount": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"format": "int64",
|
"format": "int64",
|
||||||
"title": "/ The transaction ammount, denominated in satoshis"
|
"title": "/ The transaction amount, denominated in satoshis"
|
||||||
},
|
},
|
||||||
"num_confirmations": {
|
"num_confirmations": {
|
||||||
"type": "integer",
|
"type": "integer",
|
||||||
|
@ -705,7 +705,7 @@ type OpenChannelParams struct {
|
|||||||
// unconfirmed outputs to fund the channel.
|
// unconfirmed outputs to fund the channel.
|
||||||
SpendUnconfirmed bool
|
SpendUnconfirmed bool
|
||||||
|
|
||||||
// MinHtlc is the htlc_minumum_msat value set when opening the channel.
|
// MinHtlc is the htlc_minimum_msat value set when opening the channel.
|
||||||
MinHtlc lnwire.MilliSatoshi
|
MinHtlc lnwire.MilliSatoshi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3354,7 +3354,7 @@ func (lc *LightningChannel) ProcessChanSyncMsg(
|
|||||||
|
|
||||||
// We owe them a commitment if the tip of their chain (from our Pov) is
|
// We owe them a commitment if the tip of their chain (from our Pov) is
|
||||||
// equal to what they think their next commit height should be. We'll
|
// equal to what they think their next commit height should be. We'll
|
||||||
// re-send all the updates neccessary to recreate this state, along
|
// re-send all the updates necessary to recreate this state, along
|
||||||
// with the commit sig.
|
// with the commit sig.
|
||||||
case msg.NextLocalCommitHeight == remoteTipHeight:
|
case msg.NextLocalCommitHeight == remoteTipHeight:
|
||||||
walletLog.Debugf("ChannelPoint(%v), sync: remote's next "+
|
walletLog.Debugf("ChannelPoint(%v), sync: remote's next "+
|
||||||
|
@ -1200,7 +1200,7 @@ func testTransactionSubscriptions(miner *rpctest.Harness,
|
|||||||
select {
|
select {
|
||||||
case <-time.After(time.Second * 10):
|
case <-time.After(time.Second * 10):
|
||||||
t.Fatalf("transactions not received after 10 seconds")
|
t.Fatalf("transactions not received after 10 seconds")
|
||||||
case <-unconfirmedNtfns: // Fall through on successs
|
case <-unconfirmedNtfns: // Fall through on success
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -493,7 +493,7 @@ func findPath(tx *bolt.Tx, graph *channeldb.ChannelGraph,
|
|||||||
// For each node in the graph, we create an entry in the distance map
|
// For each node in the graph, we create an entry in the distance map
|
||||||
// for the node set with a distance of "infinity". graph.ForEachNode
|
// for the node set with a distance of "infinity". graph.ForEachNode
|
||||||
// also returns the source node, so there is no need to add the source
|
// also returns the source node, so there is no need to add the source
|
||||||
// node explictly.
|
// node explicitly.
|
||||||
distance := make(map[Vertex]nodeWithDist)
|
distance := make(map[Vertex]nodeWithDist)
|
||||||
if err := graph.ForEachNode(tx, func(_ *bolt.Tx, node *channeldb.LightningNode) error {
|
if err := graph.ForEachNode(tx, func(_ *bolt.Tx, node *channeldb.LightningNode) error {
|
||||||
// TODO(roasbeef): with larger graph can just use disk seeks
|
// TODO(roasbeef): with larger graph can just use disk seeks
|
||||||
@ -597,7 +597,7 @@ func findPath(tx *bolt.Tx, graph *channeldb.ChannelGraph,
|
|||||||
// Compute fee that fromNode is charging. It is based on the
|
// Compute fee that fromNode is charging. It is based on the
|
||||||
// amount that needs to be sent to the next node in the route.
|
// amount that needs to be sent to the next node in the route.
|
||||||
//
|
//
|
||||||
// Source node has no precedessor to pay a fee. Therefore set
|
// Source node has no predecessor to pay a fee. Therefore set
|
||||||
// fee to zero, because it should not be included in the fee
|
// fee to zero, because it should not be included in the fee
|
||||||
// limit check and edge weight.
|
// limit check and edge weight.
|
||||||
//
|
//
|
||||||
|
@ -537,7 +537,7 @@ func TestSendPaymentErrorNonFinalTimeLockErrors(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Send off the payment request to the router, this payment should
|
// Send off the payment request to the router, this payment should
|
||||||
// suceed as we should actually go through Pham Nuwen in order to get
|
// succeed as we should actually go through Pham Nuwen in order to get
|
||||||
// to Sophon, even though he has higher fees.
|
// to Sophon, even though he has higher fees.
|
||||||
paymentPreImage, route, err := ctx.router.SendPayment(&payment)
|
paymentPreImage, route, err := ctx.router.SendPayment(&payment)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -1053,7 +1053,7 @@ func (s *server) Stopped() bool {
|
|||||||
return atomic.LoadInt32(&s.shutdown) != 0
|
return atomic.LoadInt32(&s.shutdown) != 0
|
||||||
}
|
}
|
||||||
|
|
||||||
// configurePortForwarding attempts to set up port forwarding for the diffrent
|
// configurePortForwarding attempts to set up port forwarding for the different
|
||||||
// ports that the server will be listening on.
|
// ports that the server will be listening on.
|
||||||
//
|
//
|
||||||
// NOTE: This should only be used when using some kind of NAT traversal to
|
// NOTE: This should only be used when using some kind of NAT traversal to
|
||||||
@ -1094,7 +1094,7 @@ func (s *server) removePortForwarding() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// watchExternalIP continously checks for an updated external IP address every
|
// watchExternalIP continuously checks for an updated external IP address every
|
||||||
// 15 minutes. Once a new IP address has been detected, it will automatically
|
// 15 minutes. Once a new IP address has been detected, it will automatically
|
||||||
// handle port forwarding rules and send updated node announcements to the
|
// handle port forwarding rules and send updated node announcements to the
|
||||||
// currently connected peers.
|
// currently connected peers.
|
||||||
@ -1165,7 +1165,7 @@ out:
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Now, we'll need to update the addresses in our node's
|
// Now, we'll need to update the addresses in our node's
|
||||||
// announcement in order to propogate the update
|
// announcement in order to propagate the update
|
||||||
// throughout the network. We'll only include addresses
|
// throughout the network. We'll only include addresses
|
||||||
// that have a different IP from the previous one, as
|
// that have a different IP from the previous one, as
|
||||||
// the previous IP is no longer valid.
|
// the previous IP is no longer valid.
|
||||||
@ -2326,7 +2326,7 @@ func (s *server) peerInitializer(p *peer) {
|
|||||||
s.wg.Add(1)
|
s.wg.Add(1)
|
||||||
go s.peerTerminationWatcher(p, ready)
|
go s.peerTerminationWatcher(p, ready)
|
||||||
|
|
||||||
// Start teh peer! If an error occurs, we Disconnect the peer, which
|
// Start the peer! If an error occurs, we Disconnect the peer, which
|
||||||
// will unblock the peerTerminationWatcher.
|
// will unblock the peerTerminationWatcher.
|
||||||
if err := p.Start(); err != nil {
|
if err := p.Start(); err != nil {
|
||||||
p.Disconnect(fmt.Errorf("unable to start peer: %v", err))
|
p.Disconnect(fmt.Errorf("unable to start peer: %v", err))
|
||||||
|
@ -124,8 +124,8 @@ func (c *Controller) sendCommand(command string) (int, string, error) {
|
|||||||
return code, reply, nil
|
return code, reply, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// parseTorReply parses the reply from the Tor server after receving a command
|
// parseTorReply parses the reply from the Tor server after receiving a command
|
||||||
// from a controller. This will parse the relevent reply parameters into a map
|
// from a controller. This will parse the relevant reply parameters into a map
|
||||||
// of keys and values.
|
// of keys and values.
|
||||||
func parseTorReply(reply string) map[string]string {
|
func parseTorReply(reply string) map[string]string {
|
||||||
params := make(map[string]string)
|
params := make(map[string]string)
|
||||||
|
@ -233,7 +233,7 @@ func IsOnionHost(host string) bool {
|
|||||||
|
|
||||||
// We'll now attempt to decode the host without its suffix, as the
|
// We'll now attempt to decode the host without its suffix, as the
|
||||||
// suffix includes invalid characters. This will tell us if the host is
|
// suffix includes invalid characters. This will tell us if the host is
|
||||||
// actually valid if succesful.
|
// actually valid if successful.
|
||||||
host = host[:suffixIndex]
|
host = host[:suffixIndex]
|
||||||
if _, err := Base32Encoding.DecodeString(host); err != nil {
|
if _, err := Base32Encoding.DecodeString(host); err != nil {
|
||||||
return false
|
return false
|
||||||
|
Loading…
Reference in New Issue
Block a user