Unassign some TODO's

This commit is contained in:
David Hill 2016-11-15 18:43:43 -05:00 committed by Dave Collins
parent d9a674e1b7
commit 807d344fe9
8 changed files with 15 additions and 15 deletions

View file

@ -169,7 +169,7 @@ func (a *AddrManager) updateAddress(netAddr, srcAddr *wire.NetAddress) {
addr := NetAddressKey(netAddr) addr := NetAddressKey(netAddr)
ka := a.find(netAddr) ka := a.find(netAddr)
if ka != nil { if ka != nil {
// TODO(oga) only update addresses periodically. // TODO: only update addresses periodically.
// Update the last seen time and services. // Update the last seen time and services.
// note that to prevent causing excess garbage on getaddr // note that to prevent causing excess garbage on getaddr
// messages the netaddresses in addrmaanger are *immutable*, // messages the netaddresses in addrmaanger are *immutable*,

View file

@ -364,7 +364,7 @@ func (b *blockManager) handleDonePeerMsg(peers *list.List, sp *serverPeer) {
// Remove requested blocks from the global map so that they will be // Remove requested blocks from the global map so that they will be
// fetched from elsewhere next time we get an inv. // fetched from elsewhere next time we get an inv.
// TODO(oga) we could possibly here check which peers have these blocks // TODO: we could possibly here check which peers have these blocks
// and request them now to speed things up a little. // and request them now to speed things up a little.
for k := range sp.requestedBlocks { for k := range sp.requestedBlocks {
delete(b.requestedBlocks, k) delete(b.requestedBlocks, k)

View file

@ -126,7 +126,7 @@ func btcdMain(serverChan chan<- *server) error {
// Create server and start it. // Create server and start it.
server, err := newServer(cfg.Listeners, db, activeNetParams.Params) server, err := newServer(cfg.Listeners, db, activeNetParams.Params)
if err != nil { if err != nil {
// TODO(oga) this logging could do with some beautifying. // TODO: this logging could do with some beautifying.
btcdLog.Errorf("Unable to start server on %v: %v", btcdLog.Errorf("Unable to start server on %v: %v",
cfg.Listeners, err) cfg.Listeners, err)
return err return err

View file

@ -25,7 +25,7 @@ func isOdd(a *big.Int) bool {
// decompressPoint decompresses a point on the given curve given the X point and // decompressPoint decompresses a point on the given curve given the X point and
// the solution to use. // the solution to use.
func decompressPoint(curve *KoblitzCurve, x *big.Int, ybit bool) (*big.Int, error) { func decompressPoint(curve *KoblitzCurve, x *big.Int, ybit bool) (*big.Int, error) {
// TODO(oga) This will probably only work for secp256k1 due to // TODO: This will probably only work for secp256k1 due to
// optimizations. // optimizations.
// Y = +-sqrt(x^3 + B) // Y = +-sqrt(x^3 + B)

View file

@ -329,7 +329,7 @@ func recoverKeyFromSignature(curve *KoblitzCurve, sig *Signature, msg []byte,
e.Mod(e, curve.Params().N) e.Mod(e, curve.Params().N)
minuseGx, minuseGy := curve.ScalarBaseMult(e.Bytes()) minuseGx, minuseGy := curve.ScalarBaseMult(e.Bytes())
// TODO(oga) this would be faster if we did a mult and add in one // TODO: this would be faster if we did a mult and add in one
// step to prevent the jacobian conversion back and forth. // step to prevent the jacobian conversion back and forth.
Qx, Qy := curve.Add(sRx, sRy, minuseGx, minuseGy) Qx, Qy := curve.Add(sRx, sRy, minuseGx, minuseGy)

View file

@ -4221,7 +4221,7 @@ func newRPCServer(listenAddrs []string, generator *mining.BlkTmplGenerator, s *s
} }
} }
// TODO(oga) this code is similar to that in server, should be // TODO: this code is similar to that in server, should be
// factored into something shared. // factored into something shared.
ipv4ListenAddrs, ipv6ListenAddrs, _, err := parseListeners(listenAddrs) ipv4ListenAddrs, ipv6ListenAddrs, _, err := parseListeners(listenAddrs)
if err != nil { if err != nil {

View file

@ -1227,7 +1227,7 @@ func (s *server) handleAddPeerMsg(state *peerState, sp *serverPeer) bool {
srvrLog.Infof("Max peers reached [%d] - disconnecting peer %s", srvrLog.Infof("Max peers reached [%d] - disconnecting peer %s",
cfg.MaxPeers, sp) cfg.MaxPeers, sp)
sp.Disconnect() sp.Disconnect()
// TODO(oga) how to handle permanent peers here? // TODO: how to handle permanent peers here?
// they should be rescheduled. // they should be rescheduled.
return false return false
} }
@ -1439,7 +1439,7 @@ func (s *server) handleQuery(state *peerState, querymsg interface{}) {
msg.reply <- peers msg.reply <- peers
case connectNodeMsg: case connectNodeMsg:
// XXX(oga) duplicate oneshots? // TODO: duplicate oneshots?
// Limit max number of total peers. // Limit max number of total peers.
if state.Count() >= cfg.MaxPeers { if state.Count() >= cfg.MaxPeers {
msg.reply <- errors.New("max peers reached") msg.reply <- errors.New("max peers reached")
@ -1462,7 +1462,7 @@ func (s *server) handleQuery(state *peerState, querymsg interface{}) {
return return
} }
// TODO(oga) if too many, nuke a non-perm peer. // TODO: if too many, nuke a non-perm peer.
go s.connManager.Connect(&connmgr.ConnReq{ go s.connManager.Connect(&connmgr.ConnReq{
Addr: netAddr, Addr: netAddr,
Permanent: msg.permanent, Permanent: msg.permanent,
@ -2119,9 +2119,9 @@ out:
for { for {
select { select {
case <-timer.C: case <-timer.C:
// TODO(oga) pick external port more cleverly // TODO: pick external port more cleverly
// TODO(oga) know which ports we are listening to on an external net. // TODO: know which ports we are listening to on an external net.
// TODO(oga) if specific listen port doesn't work then ask for wildcard // TODO: if specific listen port doesn't work then ask for wildcard
// listen port? // listen port?
// XXX this assumes timeout is in seconds. // XXX this assumes timeout is in seconds.
listenPort, err := s.nat.AddPortMapping("tcp", int(lport), int(lport), listenPort, err := s.nat.AddPortMapping("tcp", int(lport), int(lport),
@ -2130,7 +2130,7 @@ out:
srvrLog.Warnf("can't add UPnP port mapping: %v", err) srvrLog.Warnf("can't add UPnP port mapping: %v", err)
} }
if first && err == nil { if first && err == nil {
// TODO(oga): look this up periodically to see if upnp domain changed // TODO: look this up periodically to see if upnp domain changed
// and so did ip. // and so did ip.
externalip, err := s.nat.GetExternalAddress() externalip, err := s.nat.GetExternalAddress()
if err != nil { if err != nil {
@ -2229,7 +2229,7 @@ func newServer(listenAddrs []string, db database.DB, chainParams *chaincfg.Param
// nil nat here is fine, just means no upnp on network. // nil nat here is fine, just means no upnp on network.
} }
// TODO(oga) nonstandard port... // TODO: nonstandard port...
if wildcard { if wildcard {
port, err := port, err :=
strconv.ParseUint(activeNetParams.DefaultPort, strconv.ParseUint(activeNetParams.DefaultPort,

View file

@ -168,7 +168,7 @@ func mergeScripts(chainParams *chaincfg.Params, tx *wire.MsgTx, idx int,
pkScript []byte, class ScriptClass, addresses []btcutil.Address, pkScript []byte, class ScriptClass, addresses []btcutil.Address,
nRequired int, sigScript, prevScript []byte) []byte { nRequired int, sigScript, prevScript []byte) []byte {
// TODO(oga) the scripthash and multisig paths here are overly // TODO: the scripthash and multisig paths here are overly
// inefficient in that they will recompute already known data. // inefficient in that they will recompute already known data.
// some internal refactoring could probably make this avoid needless // some internal refactoring could probably make this avoid needless
// extra calculations. // extra calculations.