make format

pull/269/head
Ryan Tharp 5 years ago
parent fefb012bf8
commit 4bf4faa956

@ -23,7 +23,9 @@ namespace llarp
{ {
namespace dht namespace dht
{ {
AbstractContext::~AbstractContext() {} AbstractContext::~AbstractContext()
{
}
Context::Context() : router(nullptr), allowTransit(false) Context::Context() : router(nullptr), allowTransit(false)
{ {

@ -31,17 +31,16 @@ namespace llarp
/// on behalf of whoasked request introset for target from dht router with /// on behalf of whoasked request introset for target from dht router with
/// key askpeer /// key askpeer
virtual void virtual void
LookupIntroSetRecursive(const service::Address& target, LookupIntroSetRecursive(
const Key_t& whoasked, uint64_t whoaskedTX, const service::Address& target, const Key_t& whoasked,
const Key_t& askpeer, uint64_t R, uint64_t whoaskedTX, const Key_t& askpeer, uint64_t R,
service::IntroSetLookupHandler result = nullptr) = 0; service::IntroSetLookupHandler result = nullptr) = 0;
virtual void virtual void
LookupIntroSetIterative(const service::Address& target, LookupIntroSetIterative(
const Key_t& whoasked, uint64_t whoaskedTX, const service::Address& target, const Key_t& whoasked,
const Key_t& askpeer, uint64_t whoaskedTX, const Key_t& askpeer,
service::IntroSetLookupHandler result = nullptr) = 0; service::IntroSetLookupHandler result = nullptr) = 0;
virtual std::set< service::IntroSet > virtual std::set< service::IntroSet >
FindRandomIntroSetsWithTagExcluding( FindRandomIntroSetsWithTagExcluding(
@ -63,7 +62,8 @@ namespace llarp
virtual const Key_t& virtual const Key_t&
OurKey() const = 0; OurKey() const = 0;
virtual Bucket< RCNode >* Nodes() const = 0; virtual Bucket< RCNode >*
Nodes() const = 0;
}; };
struct Context final : public AbstractContext struct Context final : public AbstractContext
@ -80,16 +80,16 @@ namespace llarp
/// on behalf of whoasked request introset for target from dht router with /// on behalf of whoasked request introset for target from dht router with
/// key askpeer /// key askpeer
void void
LookupIntroSetRecursive(const service::Address& target, LookupIntroSetRecursive(
const Key_t& whoasked, uint64_t whoaskedTX, const service::Address& target, const Key_t& whoasked,
const Key_t& askpeer, uint64_t R, uint64_t whoaskedTX, const Key_t& askpeer, uint64_t R,
service::IntroSetLookupHandler result = nullptr) override; service::IntroSetLookupHandler result = nullptr) override;
void void
LookupIntroSetIterative(const service::Address& target, LookupIntroSetIterative(
const Key_t& whoasked, uint64_t whoaskedTX, const service::Address& target, const Key_t& whoasked,
const Key_t& askpeer, uint64_t whoaskedTX, const Key_t& askpeer,
service::IntroSetLookupHandler result = nullptr) override; service::IntroSetLookupHandler result = nullptr) override;
/// on behalf of whoasked request router with public key target from dht /// on behalf of whoasked request router with public key target from dht
/// router with key askpeer /// router with key askpeer
@ -141,7 +141,8 @@ namespace llarp
/// send a dht message to peer, if keepalive is true then keep the session /// send a dht message to peer, if keepalive is true then keep the session
/// with that peer alive for 10 seconds /// with that peer alive for 10 seconds
void void
DHTSendTo(const RouterID& peer, IMessage* msg, bool keepalive = true) override; DHTSendTo(const RouterID& peer, IMessage* msg,
bool keepalive = true) override;
/// get routers closest to target excluding requester /// get routers closest to target excluding requester
bool bool
@ -198,7 +199,11 @@ namespace llarp
std::unique_ptr< Bucket< ISNode > > services; std::unique_ptr< Bucket< ISNode > > services;
bool allowTransit; bool allowTransit;
Bucket< RCNode >* Nodes() const override { return nodes.get(); } Bucket< RCNode >*
Nodes() const override
{
return nodes.get();
}
const Key_t& const Key_t&
OurKey() const override OurKey() const override
@ -207,7 +212,10 @@ namespace llarp
} }
llarp::Router* llarp::Router*
GetRouter() const override { return router; } GetRouter() const override
{
return router;
}
TXHolder< service::Address, service::IntroSet, service::Address::Hash > TXHolder< service::Address, service::IntroSet, service::Address::Hash >
pendingIntrosetLookups; pendingIntrosetLookups;

@ -11,7 +11,8 @@ namespace llarp
namespace dht namespace dht
{ {
LocalRouterLookup::LocalRouterLookup(const PathID_t &path, uint64_t txid, LocalRouterLookup::LocalRouterLookup(const PathID_t &path, uint64_t txid,
const RouterID &target, AbstractContext *ctx) const RouterID &target,
AbstractContext *ctx)
: RecursiveRouterLookup(TXOwner{ctx->OurKey(), txid}, target, ctx, : RecursiveRouterLookup(TXOwner{ctx->OurKey(), txid}, target, ctx,
nullptr) nullptr)
, localPath(path) , localPath(path)

@ -14,7 +14,8 @@ namespace llarp
PathID_t localPath; PathID_t localPath;
LocalServiceAddressLookup(const PathID_t &pathid, uint64_t txid, LocalServiceAddressLookup(const PathID_t &pathid, uint64_t txid,
const service::Address &addr, AbstractContext *ctx, const service::Address &addr,
AbstractContext *ctx,
__attribute__((unused)) const Key_t &askpeer); __attribute__((unused)) const Key_t &askpeer);
void void

@ -10,7 +10,8 @@ namespace llarp
namespace dht namespace dht
{ {
LocalTagLookup::LocalTagLookup(const PathID_t &path, uint64_t txid, LocalTagLookup::LocalTagLookup(const PathID_t &path, uint64_t txid,
const service::Tag &target, AbstractContext *ctx) const service::Tag &target,
AbstractContext *ctx)
: TagLookup(TXOwner{ctx->OurKey(), txid}, target, ctx, 0) : TagLookup(TXOwner{ctx->OurKey(), txid}, target, ctx, 0)
, localPath(path) , localPath(path)
{ {

@ -12,7 +12,7 @@ namespace llarp
} }
bool bool
FindIntroMessage::DecodeKey(const llarp_buffer_t &k, llarp_buffer_t* val) FindIntroMessage::DecodeKey(const llarp_buffer_t& k, llarp_buffer_t* val)
{ {
bool read = false; bool read = false;

@ -51,7 +51,7 @@ namespace llarp
BEncode(llarp_buffer_t* buf) const override; BEncode(llarp_buffer_t* buf) const override;
bool bool
DecodeKey(const llarp_buffer_t &key, llarp_buffer_t* val) override; DecodeKey(const llarp_buffer_t& key, llarp_buffer_t* val) override;
bool bool
HandleMessage( HandleMessage(

@ -31,7 +31,7 @@ namespace llarp
BEncode(llarp_buffer_t* buf) const override; BEncode(llarp_buffer_t* buf) const override;
bool bool
DecodeKey(const llarp_buffer_t &key, llarp_buffer_t* val) override; DecodeKey(const llarp_buffer_t& key, llarp_buffer_t* val) override;
virtual bool virtual bool
HandleMessage( HandleMessage(

@ -40,7 +40,7 @@ namespace llarp
BEncode(llarp_buffer_t* buf) const override; BEncode(llarp_buffer_t* buf) const override;
bool bool
DecodeKey(const llarp_buffer_t &key, llarp_buffer_t* val) override; DecodeKey(const llarp_buffer_t& key, llarp_buffer_t* val) override;
virtual bool virtual bool
HandleMessage( HandleMessage(

@ -38,7 +38,7 @@ namespace llarp
BEncode(llarp_buffer_t* buf) const override; BEncode(llarp_buffer_t* buf) const override;
bool bool
DecodeKey(const llarp_buffer_t &key, llarp_buffer_t* val) override; DecodeKey(const llarp_buffer_t& key, llarp_buffer_t* val) override;
virtual bool virtual bool
HandleMessage( HandleMessage(

@ -15,7 +15,8 @@ namespace llarp
} }
bool bool
PublishIntroMessage::DecodeKey(const llarp_buffer_t &key, llarp_buffer_t *val) PublishIntroMessage::DecodeKey(const llarp_buffer_t &key,
llarp_buffer_t *val)
{ {
bool read = false; bool read = false;
if(llarp_buffer_eq(key, "E")) if(llarp_buffer_eq(key, "E"))

@ -35,7 +35,7 @@ namespace llarp
BEncode(llarp_buffer_t* buf) const override; BEncode(llarp_buffer_t* buf) const override;
bool bool
DecodeKey(const llarp_buffer_t &key, llarp_buffer_t* val) override; DecodeKey(const llarp_buffer_t& key, llarp_buffer_t* val) override;
virtual bool virtual bool
HandleMessage( HandleMessage(

@ -9,8 +9,9 @@ namespace llarp
namespace dht namespace dht
{ {
ServiceAddressLookup::ServiceAddressLookup( ServiceAddressLookup::ServiceAddressLookup(
const TXOwner &asker, const service::Address &addr, AbstractContext *ctx, const TXOwner &asker, const service::Address &addr,
uint64_t r, service::IntroSetLookupHandler handler) AbstractContext *ctx, uint64_t r,
service::IntroSetLookupHandler handler)
: TX< service::Address, service::IntroSet >(asker, addr, ctx) : TX< service::Address, service::IntroSet >(asker, addr, ctx)
, handleResult(handler) , handleResult(handler)
, R(r) , R(r)

@ -12,8 +12,8 @@ namespace llarp
struct TagLookup : public TX< service::Tag, service::IntroSet > struct TagLookup : public TX< service::Tag, service::IntroSet >
{ {
uint64_t R; uint64_t R;
TagLookup(const TXOwner &asker, const service::Tag &tag, AbstractContext *ctx, TagLookup(const TXOwner &asker, const service::Tag &tag,
uint64_t r) AbstractContext *ctx, uint64_t r)
: TX< service::Tag, service::IntroSet >(asker, tag, ctx), R(r) : TX< service::Tag, service::IntroSet >(asker, tag, ctx), R(r)
{ {
} }

@ -7,7 +7,7 @@ namespace llarp
{ {
namespace dns namespace dns
{ {
constexpr uint16_t qTypeAAAA = 28; constexpr uint16_t qTypeAAAA = 28;
constexpr uint16_t qTypeTXT = 16; constexpr uint16_t qTypeTXT = 16;
constexpr uint16_t qTypeMX = 15; constexpr uint16_t qTypeMX = 15;
constexpr uint16_t qTypePTR = 12; constexpr uint16_t qTypePTR = 12;

@ -114,7 +114,7 @@ namespace llarp
ObtainServiceNodeIP(const RouterID& router); ObtainServiceNodeIP(const RouterID& router);
bool bool
QueueSNodePacket(const llarp_buffer_t & buf, huint32_t from); QueueSNodePacket(const llarp_buffer_t& buf, huint32_t from);
void void
MarkIPActive(huint32_t ip); MarkIPActive(huint32_t ip);

@ -1057,8 +1057,7 @@ namespace llarp
llarp_buffer_t out(rxFragBody); llarp_buffer_t out(rxFragBody);
// decrypt // decrypt
if(!Crypto()->xchacha20_alt(out, in, rxKey, if(!Crypto()->xchacha20_alt(out, in, rxKey, ptr + FragmentHashSize))
ptr + FragmentHashSize))
{ {
llarp::LogError("failed to decrypt message from ", remoteAddr); llarp::LogError("failed to decrypt message from ", remoteAddr);
return false; return false;
@ -1083,8 +1082,7 @@ namespace llarp
llarp::LogError("failed to read the rest of the header"); llarp::LogError("failed to read the rest of the header");
return false; return false;
} }
if(length if(length > (out.sz - (out.cur - out.base)))
> (out.sz - (out.cur - out.base)))
{ {
// too big length // too big length
llarp::LogError("fragment body too big"); llarp::LogError("fragment body too big");

@ -18,7 +18,7 @@ namespace llarp
~DHTMessage(); ~DHTMessage();
bool bool
DecodeKey(const llarp_buffer_t &key, llarp_buffer_t* val) override; DecodeKey(const llarp_buffer_t& key, llarp_buffer_t* val) override;
bool bool
BEncode(llarp_buffer_t* buf) const override; BEncode(llarp_buffer_t* buf) const override;

@ -19,7 +19,7 @@ namespace llarp
std::vector< std::unique_ptr< llarp::dht::IMessage > > msgs; std::vector< std::unique_ptr< llarp::dht::IMessage > > msgs;
bool bool
DecodeKey(const llarp_buffer_t &key, llarp_buffer_t* buf) override; DecodeKey(const llarp_buffer_t& key, llarp_buffer_t* buf) override;
bool bool
BEncode(llarp_buffer_t* buf) const override; BEncode(llarp_buffer_t* buf) const override;

@ -53,7 +53,7 @@ namespace llarp
BEncode(llarp_buffer_t* buf) const override; BEncode(llarp_buffer_t* buf) const override;
bool bool
DecodeKey(const llarp_buffer_t &key, llarp_buffer_t* buf) override; DecodeKey(const llarp_buffer_t& key, llarp_buffer_t* buf) override;
bool bool
HandleMessage(IMessageHandler* h, llarp::Router* r) const override; HandleMessage(IMessageHandler* h, llarp::Router* r) const override;
@ -86,7 +86,7 @@ namespace llarp
Verify(llarp::Crypto* c, const llarp::PubKey& pk) const; Verify(llarp::Crypto* c, const llarp::PubKey& pk) const;
bool bool
DecodeKey(const llarp_buffer_t &key, llarp_buffer_t* buf) override; DecodeKey(const llarp_buffer_t& key, llarp_buffer_t* buf) override;
bool bool
HandleMessage(IMessageHandler* h, llarp::Router* r) const override; HandleMessage(IMessageHandler* h, llarp::Router* r) const override;
@ -140,7 +140,7 @@ namespace llarp
BEncode(llarp_buffer_t* buf) const override; BEncode(llarp_buffer_t* buf) const override;
bool bool
DecodeKey(const llarp_buffer_t &key, llarp_buffer_t* buf) override; DecodeKey(const llarp_buffer_t& key, llarp_buffer_t* buf) override;
bool bool
HandleMessage(IMessageHandler* h, llarp::Router* r) const override; HandleMessage(IMessageHandler* h, llarp::Router* r) const override;
@ -182,7 +182,7 @@ namespace llarp
BEncode(llarp_buffer_t* buf) const override; BEncode(llarp_buffer_t* buf) const override;
bool bool
DecodeKey(const llarp_buffer_t &key, llarp_buffer_t* buf) override; DecodeKey(const llarp_buffer_t& key, llarp_buffer_t* buf) override;
bool bool
HandleMessage(IMessageHandler* h, llarp::Router* r) const override; HandleMessage(IMessageHandler* h, llarp::Router* r) const override;
@ -217,7 +217,7 @@ namespace llarp
BEncode(llarp_buffer_t* buf) const override; BEncode(llarp_buffer_t* buf) const override;
bool bool
DecodeKey(const llarp_buffer_t &key, llarp_buffer_t* buf) override; DecodeKey(const llarp_buffer_t& key, llarp_buffer_t* buf) override;
bool bool
HandleMessage(IMessageHandler* h, llarp::Router* r) const override; HandleMessage(IMessageHandler* h, llarp::Router* r) const override;

@ -19,7 +19,7 @@ namespace llarp
BEncode(llarp_buffer_t* buf) const override; BEncode(llarp_buffer_t* buf) const override;
bool bool
DecodeKey(const llarp_buffer_t &key, llarp_buffer_t* val) override; DecodeKey(const llarp_buffer_t& key, llarp_buffer_t* val) override;
bool bool
HandleMessage(IMessageHandler* h, llarp::Router* r) const override; HandleMessage(IMessageHandler* h, llarp::Router* r) const override;

@ -17,7 +17,7 @@ namespace llarp
BEncode(llarp_buffer_t* buf) const override; BEncode(llarp_buffer_t* buf) const override;
bool bool
DecodeKey(const llarp_buffer_t &key, llarp_buffer_t* val) override; DecodeKey(const llarp_buffer_t& key, llarp_buffer_t* val) override;
void void
Clear() override Clear() override

@ -25,7 +25,7 @@ namespace llarp
~PathTransferMessage(); ~PathTransferMessage();
bool bool
DecodeKey(const llarp_buffer_t &key, llarp_buffer_t* val) override; DecodeKey(const llarp_buffer_t& key, llarp_buffer_t* val) override;
bool bool
BEncode(llarp_buffer_t* buf) const override; BEncode(llarp_buffer_t* buf) const override;

@ -21,7 +21,7 @@ namespace llarp
~RelayUpstreamMessage(); ~RelayUpstreamMessage();
bool bool
DecodeKey(const llarp_buffer_t &key, llarp_buffer_t* buf) override; DecodeKey(const llarp_buffer_t& key, llarp_buffer_t* buf) override;
bool bool
BEncode(llarp_buffer_t* buf) const override; BEncode(llarp_buffer_t* buf) const override;
@ -43,7 +43,7 @@ namespace llarp
~RelayDownstreamMessage(); ~RelayDownstreamMessage();
bool bool
DecodeKey(const llarp_buffer_t &key, llarp_buffer_t* buf) override; DecodeKey(const llarp_buffer_t& key, llarp_buffer_t* buf) override;
bool bool
BEncode(llarp_buffer_t* buf) const override; BEncode(llarp_buffer_t* buf) const override;

@ -279,11 +279,12 @@ namespace llarp
return; return;
} }
// generate hash of hop key for nonce mutation // generate hash of hop key for nonce mutation
crypto->shorthash(self->hop->nonceXOR, llarp_buffer_t(self->hop->pathKey)); crypto->shorthash(self->hop->nonceXOR,
llarp_buffer_t(self->hop->pathKey));
using namespace std::placeholders; using namespace std::placeholders;
if(self->record.work if(self->record.work
&& self->record.work->IsValid( && self->record.work->IsValid(
std::bind(&Crypto::shorthash, crypto, _1, _2), now)) std::bind(&Crypto::shorthash, crypto, _1, _2), now))
{ {
llarp::LogDebug("LRCM extended lifetime by ", llarp::LogDebug("LRCM extended lifetime by ",
self->record.work->extendedLifetime, " seconds for ", self->record.work->extendedLifetime, " seconds for ",

@ -68,7 +68,7 @@ namespace llarp
} }
bool bool
ExitInfo::DecodeKey(const llarp_buffer_t &k, llarp_buffer_t* buf) ExitInfo::DecodeKey(const llarp_buffer_t& k, llarp_buffer_t* buf)
{ {
bool read = false; bool read = false;
if(!BEncodeMaybeReadDictEntry("k", pubkey, read, k, buf)) if(!BEncodeMaybeReadDictEntry("k", pubkey, read, k, buf))

@ -23,8 +23,8 @@ namespace llarp
struct in6_addr netmask; struct in6_addr netmask;
PubKey pubkey; PubKey pubkey;
ExitInfo(const PubKey &pk, const nuint32_t &ipv4_exit) : IBEncodeMessage(), ExitInfo(const PubKey &pk, const nuint32_t &ipv4_exit)
pubkey(pk) : IBEncodeMessage(), pubkey(pk)
{ {
memset(address.s6_addr, 0, 16); memset(address.s6_addr, 0, 16);
address.s6_addr[11] = 0xff; address.s6_addr[11] = 0xff;
@ -37,8 +37,8 @@ namespace llarp
{ {
} }
ExitInfo(const ExitInfo &other) : IBEncodeMessage(other.version), ExitInfo(const ExitInfo &other)
pubkey(other.pubkey) : IBEncodeMessage(other.version), pubkey(other.pubkey)
{ {
memcpy(address.s6_addr, other.address.s6_addr, 16); memcpy(address.s6_addr, other.address.s6_addr, 16);
memcpy(netmask.s6_addr, other.netmask.s6_addr, 16); memcpy(netmask.s6_addr, other.netmask.s6_addr, 16);

@ -155,26 +155,24 @@ namespace llarp
IHopHandler* IHopHandler*
PathContext::GetByUpstream(const RouterID& remote, const PathID_t& id) PathContext::GetByUpstream(const RouterID& remote, const PathID_t& id)
{ {
auto own = MapGet( auto own = MapGet(m_OurPaths, id,
m_OurPaths, id, [](__attribute__((unused)) const PathSet* s) -> bool {
[](__attribute__((unused)) const PathSet* s) -> bool { // TODO: is this right?
// TODO: is this right? return true;
return true; },
}, [remote, id](PathSet* p) -> IHopHandler* {
[remote, id](PathSet* p) -> IHopHandler* { return p->GetByUpstream(remote, id);
return p->GetByUpstream(remote, id); });
});
if(own) if(own)
return own; return own;
return MapGet( return MapGet(m_TransitPaths, id,
m_TransitPaths, id, [remote](const std::shared_ptr< TransitHop >& hop) -> bool {
[remote](const std::shared_ptr< TransitHop >& hop) -> bool { return hop->info.upstream == remote;
return hop->info.upstream == remote; },
}, [](const std::shared_ptr< TransitHop >& h) -> IHopHandler* {
[](const std::shared_ptr< TransitHop >& h) -> IHopHandler* { return h.get();
return h.get(); });
});
} }
bool bool
@ -191,14 +189,13 @@ namespace llarp
IHopHandler* IHopHandler*
PathContext::GetByDownstream(const RouterID& remote, const PathID_t& id) PathContext::GetByDownstream(const RouterID& remote, const PathID_t& id)
{ {
return MapGet( return MapGet(m_TransitPaths, id,
m_TransitPaths, id, [remote](const std::shared_ptr< TransitHop >& hop) -> bool {
[remote](const std::shared_ptr< TransitHop >& hop) -> bool { return hop->info.downstream == remote;
return hop->info.downstream == remote; },
}, [](const std::shared_ptr< TransitHop >& h) -> IHopHandler* {
[](const std::shared_ptr< TransitHop >& h) -> IHopHandler* { return h.get();
return h.get(); });
});
} }
PathSet* PathSet*

@ -21,7 +21,7 @@ namespace llarp
IsValid(shorthash_func hashfunc, llarp_time_t now) const; IsValid(shorthash_func hashfunc, llarp_time_t now) const;
bool bool
DecodeKey(const llarp_buffer_t &k, llarp_buffer_t* val) override; DecodeKey(const llarp_buffer_t& k, llarp_buffer_t* val) override;
bool bool
BEncode(llarp_buffer_t* buf) const override; BEncode(llarp_buffer_t* buf) const override;

@ -26,7 +26,7 @@ namespace llarp
BEncode(llarp_buffer_t* buf) const override; BEncode(llarp_buffer_t* buf) const override;
bool bool
DecodeKey(const llarp_buffer_t &k, llarp_buffer_t* buf) override; DecodeKey(const llarp_buffer_t& k, llarp_buffer_t* buf) override;
bool bool
IsGood(uint64_t chances) const; IsGood(uint64_t chances) const;
@ -55,7 +55,7 @@ namespace llarp
BEncode(llarp_buffer_t* buf) const override; BEncode(llarp_buffer_t* buf) const override;
bool bool
DecodeKey(const llarp_buffer_t &k, llarp_buffer_t* buf) override; DecodeKey(const llarp_buffer_t& k, llarp_buffer_t* buf) override;
bool bool
Load(const char* fname); Load(const char* fname);

@ -191,7 +191,7 @@ namespace llarp
}; };
using RouterLookupHandler = using RouterLookupHandler =
std::function< void(const std::vector< RouterContact >&) >; std::function< void(const std::vector< RouterContact > &) >;
} // namespace llarp } // namespace llarp
#endif #endif

@ -11,7 +11,7 @@ namespace llarp
} }
bool bool
DHTMessage::DecodeKey(const llarp_buffer_t &key, llarp_buffer_t* val) DHTMessage::DecodeKey(const llarp_buffer_t& key, llarp_buffer_t* val)
{ {
llarp::dht::Key_t from; llarp::dht::Key_t from;
from.Zero(); from.Zero();

@ -18,7 +18,8 @@ namespace llarp
} }
bool bool
PathConfirmMessage::DecodeKey(const llarp_buffer_t &key, llarp_buffer_t* val) PathConfirmMessage::DecodeKey(const llarp_buffer_t& key,
llarp_buffer_t* val)
{ {
bool read = false; bool read = false;
if(!BEncodeMaybeReadDictInt("L", pathLifetime, read, key, val)) if(!BEncodeMaybeReadDictInt("L", pathLifetime, read, key, val))

@ -10,7 +10,8 @@ namespace llarp
} }
bool bool
PathLatencyMessage::DecodeKey(const llarp_buffer_t &key, llarp_buffer_t* val) PathLatencyMessage::DecodeKey(const llarp_buffer_t& key,
llarp_buffer_t* val)
{ {
bool read = false; bool read = false;
if(!BEncodeMaybeReadDictInt("L", L, read, key, val)) if(!BEncodeMaybeReadDictInt("L", L, read, key, val))

@ -16,7 +16,8 @@ namespace llarp
} }
bool bool
PathTransferMessage::DecodeKey(const llarp_buffer_t &key, llarp_buffer_t* val) PathTransferMessage::DecodeKey(const llarp_buffer_t& key,
llarp_buffer_t* val)
{ {
bool read = false; bool read = false;
if(!BEncodeMaybeReadDictEntry("P", P, read, key, val)) if(!BEncodeMaybeReadDictEntry("P", P, read, key, val))

@ -9,7 +9,7 @@ namespace llarp
} }
bool bool
Introduction::DecodeKey(const llarp_buffer_t &key, llarp_buffer_t* buf) Introduction::DecodeKey(const llarp_buffer_t& key, llarp_buffer_t* buf)
{ {
bool read = false; bool read = false;
if(!BEncodeMaybeReadDictEntry("k", router, read, key, buf)) if(!BEncodeMaybeReadDictEntry("k", router, read, key, buf))

@ -56,7 +56,7 @@ namespace llarp
BEncode(llarp_buffer_t* buf) const override; BEncode(llarp_buffer_t* buf) const override;
bool bool
DecodeKey(const llarp_buffer_t &key, llarp_buffer_t* buf) override; DecodeKey(const llarp_buffer_t& key, llarp_buffer_t* buf) override;
void void
Clear(); Clear();

@ -149,7 +149,7 @@ namespace llarp
BEncode(llarp_buffer_t* buf) const override; BEncode(llarp_buffer_t* buf) const override;
bool bool
DecodeKey(const llarp_buffer_t &key, llarp_buffer_t* buf) override; DecodeKey(const llarp_buffer_t& key, llarp_buffer_t* buf) override;
bool bool
Verify(llarp::Crypto* crypto, llarp_time_t now) const; Verify(llarp::Crypto* crypto, llarp_time_t now) const;

@ -34,7 +34,7 @@ namespace llarp
static size_t static size_t
Base32DecodeSize(size_t sz) Base32DecodeSize(size_t sz)
{ {
return DecodeSize<5, 8>(sz); return DecodeSize< 5, 8 >(sz);
} }
template < typename Stack, typename V > template < typename Stack, typename V >

Loading…
Cancel
Save