From b5dc10bc385d8760f9dccff1c9e9d96032676f8f Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 15 Aug 2017 11:28:25 +0200 Subject: [PATCH 1/3] Test http fix --- src/httprpc.cpp | 5 +++++ src/komodo_gateway.h | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/httprpc.cpp b/src/httprpc.cpp index 98ac750bb..2a465ee54 100644 --- a/src/httprpc.cpp +++ b/src/httprpc.cpp @@ -13,6 +13,9 @@ #include // boost::trim +// WWW-Authenticate to present with 401 Unauthorized response +static const char *WWW_AUTH_HEADER_DATA = "Basic realm=\"jsonrpc\""; + /** Simple one-shot callback timer to be used by the RPC mechanism to e.g. * re-lock the wellet. */ @@ -94,6 +97,7 @@ static bool HTTPReq_JSONRPC(HTTPRequest* req, const std::string &) // Check authorization std::pair authHeader = req->GetHeader("authorization"); if (!authHeader.first) { + req->WriteHeader("WWW-Authenticate", WWW_AUTH_HEADER_DATA); req->WriteReply(HTTP_UNAUTHORIZED); return false; } @@ -106,6 +110,7 @@ static bool HTTPReq_JSONRPC(HTTPRequest* req, const std::string &) shouldn't have their RPC port exposed. */ MilliSleep(250); + req->WriteHeader("WWW-Authenticate", WWW_AUTH_HEADER_DATA); req->WriteReply(HTTP_UNAUTHORIZED); return false; } diff --git a/src/komodo_gateway.h b/src/komodo_gateway.h index 088e8d415..bb121e4e1 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -449,7 +449,7 @@ int32_t komodo_pending_withdraws(char *opretstr) // todo: enforce deterministic if ( n > 0 ) { opretbuf[len++] = 'A'; - qsort(paxes,n,sizeof(*paxes),_paxorder); + mergesort(paxes,n,sizeof(*paxes),_paxorder); for (i=0; i>3)*7 ) From 57892e5aaac05454982b232b742d6ab08738d32b Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 15 Aug 2017 11:31:01 +0200 Subject: [PATCH 2/3] Test --- src/komodo_gateway.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/komodo_gateway.h b/src/komodo_gateway.h index bb121e4e1..088e8d415 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -449,7 +449,7 @@ int32_t komodo_pending_withdraws(char *opretstr) // todo: enforce deterministic if ( n > 0 ) { opretbuf[len++] = 'A'; - mergesort(paxes,n,sizeof(*paxes),_paxorder); + qsort(paxes,n,sizeof(*paxes),_paxorder); for (i=0; i>3)*7 ) From b310d58530150222e387c901af6110554edb39fd Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 22 Aug 2017 09:18:46 +0200 Subject: [PATCH 3/3] Hot fix for excessive fees --- src/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index b2a4317df..c14fd7995 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1301,7 +1301,7 @@ bool AcceptToMemoryPool(CTxMemPool& pool, CValidationState &state, const CTransa dFreeCount += nSize; } - if (fRejectAbsurdFee && nFees > ::minRelayTxFee.GetFee(nSize) * 10000 && nFees > nValueOut/20 ) + if (fRejectAbsurdFee && nFees > ::minRelayTxFee.GetFee(nSize) * 10000 && nFees > nValueOut/19 ) { fprintf(stderr,"accept failure.8\n"); return error("AcceptToMemoryPool: absurdly high fees %s, %d > %d",hash.ToString(), nFees, ::minRelayTxFee.GetFee(nSize) * 10000);