From 0e1421f0d372a163bbbdd33918e419dff150d5ce Mon Sep 17 00:00:00 2001 From: EDDragonWolf Date: Tue, 13 Feb 2018 11:49:00 +0200 Subject: [PATCH] Added initial logs for all DAPI calls --- src/supernode/PosProxy.cpp | 3 ++- src/supernode/PosSaleObject.cpp | 4 ++++ src/supernode/WalletPayObject.cpp | 1 + src/supernode/WalletProxy.cpp | 4 +++- src/supernode/baseclientproxy.cpp | 4 ++++ src/supernode/main.cpp | 2 +- 6 files changed, 15 insertions(+), 3 deletions(-) diff --git a/src/supernode/PosProxy.cpp b/src/supernode/PosProxy.cpp index 093c1cd37..47589d998 100644 --- a/src/supernode/PosProxy.cpp +++ b/src/supernode/PosProxy.cpp @@ -39,6 +39,7 @@ void supernode::PosProxy::Init() { bool supernode::PosProxy::Sale(const rpc_command::POS_SALE::request& in, rpc_command::POS_SALE::response& out) { + LOG_PRINT_L0("PosProxy::Sale" << in.POSAddress << in.Amount); //TODO: Add input data validation boost::shared_ptr data = boost::shared_ptr( new PosSaleObject() ); data->Owner(this); @@ -48,7 +49,7 @@ bool supernode::PosProxy::Sale(const rpc_command::POS_SALE::request& in, rpc_com if (!data->Init(in)) { out.Result = ERROR_SALE_REQUEST_FAILED; - LOG_PRINT_L5("ERROR_SALE_REQUEST_FAILED"); + LOG_PRINT_L0("ERROR_SALE_REQUEST_FAILED"); return false; } Add(data); diff --git a/src/supernode/PosSaleObject.cpp b/src/supernode/PosSaleObject.cpp index 8ce79c50d..71487a1f1 100644 --- a/src/supernode/PosSaleObject.cpp +++ b/src/supernode/PosSaleObject.cpp @@ -141,12 +141,14 @@ void supernode::PosSaleObject::ContinueInit() { } bool supernode::PosSaleObject::AuthWalletRejectPay(const rpc_command::WALLET_REJECT_PAY::request &in, rpc_command::WALLET_REJECT_PAY::response &out) { + LOG_PRINT_L0("PosSaleObject::AuthWalletRejectPay" << in.PaymentID); m_Status = NTransactionStatus::RejectedByWallet; return true; } bool supernode::PosSaleObject::GetSaleStatus(const rpc_command::POS_GET_SALE_STATUS::request& in, rpc_command::POS_GET_SALE_STATUS::response& out) { + LOG_PRINT_L0("PosSaleObject::GetSaleStatus" << in.PaymentID); out.Status = int(m_Status); out.Result = STATUS_OK; return true; @@ -154,6 +156,7 @@ bool supernode::PosSaleObject::GetSaleStatus(const rpc_command::POS_GET_SALE_STA bool supernode::PosSaleObject::PoSTRSigned(const rpc_command::POS_TR_SIGNED::request& in, rpc_command::POS_TR_SIGNED::response& out) { + LOG_PRINT_L0("PosSaleObject::PoSTRSigned" << in.PaymentID); { boost::lock_guard lock(m_TxInPoolGotGuard); if(m_TxInPoolGot) return true; @@ -252,6 +255,7 @@ bool supernode::PosSaleObject::PoSTRSigned(const rpc_command::POS_TR_SIGNED::req bool supernode::PosSaleObject::PosRejectSale(const supernode::rpc_command::POS_REJECT_SALE::request &in, supernode::rpc_command::POS_REJECT_SALE::response &out) { + LOG_PRINT_L0("PosSaleObject::PosRejectSale" << in.PaymentID); m_Status = NTransactionStatus::RejectedByPOS; //TODO: Add impl diff --git a/src/supernode/WalletPayObject.cpp b/src/supernode/WalletPayObject.cpp index be951be04..acc84dac9 100644 --- a/src/supernode/WalletPayObject.cpp +++ b/src/supernode/WalletPayObject.cpp @@ -123,6 +123,7 @@ bool supernode::WalletPayObject::_Init(const rpc_command::WALLET_PAY::request& s } bool supernode::WalletPayObject::GetPayStatus(const rpc_command::WALLET_GET_TRANSACTION_STATUS::request& in, rpc_command::WALLET_GET_TRANSACTION_STATUS::response& out) { + LOG_PRINT_L0("WalletPayObject::GetPayStatus" << in.PaymentID); out.Status = int(m_Status); //TimeMark -= boost::posix_time::hours(3); out.Result = STATUS_OK; diff --git a/src/supernode/WalletProxy.cpp b/src/supernode/WalletProxy.cpp index d3264eb81..413c0cfb7 100644 --- a/src/supernode/WalletProxy.cpp +++ b/src/supernode/WalletProxy.cpp @@ -40,7 +40,7 @@ void supernode::WalletProxy::Init() { bool supernode::WalletProxy::WalletRejectPay(const rpc_command::WALLET_REJECT_PAY::request &in, rpc_command::WALLET_REJECT_PAY::response &out) { // TODO: if have PayID, don't call - + LOG_PRINT_L0("WalletProxy::WalletRejectPay" << in.PaymentID); SubNetBroadcast sub; sub.Set( m_DAPIServer, in.PaymentID, m_Servant->GetAuthSample(in.BlockNum) ); vector vout; @@ -51,6 +51,7 @@ bool supernode::WalletProxy::WalletRejectPay(const rpc_command::WALLET_REJECT_PA bool supernode::WalletProxy::Pay(const rpc_command::WALLET_PAY::request& in, rpc_command::WALLET_PAY::response& out) { + LOG_PRINT_L0("WalletProxy::Pay" << in.POSAddress << in.Amount); boost::shared_ptr data = boost::shared_ptr( new WalletPayObject() ); data->Owner(this); Setup(data); @@ -68,6 +69,7 @@ bool supernode::WalletProxy::Pay(const rpc_command::WALLET_PAY::request& in, rpc } bool supernode::WalletProxy::WalletGetPosData(const rpc_command::WALLET_GET_POS_DATA::request& in, rpc_command::WALLET_GET_POS_DATA::response& out) { + LOG_PRINT_L0("WalletProxy::WalletGetPosData" << in.PaymentID); // we allready have block num vector< boost::shared_ptr > vv = m_Servant->GetAuthSample( in.BlockNum ); if( vv.size()!=m_Servant->AuthSampleSize() ) return false; diff --git a/src/supernode/baseclientproxy.cpp b/src/supernode/baseclientproxy.cpp index 510a51240..aed71f29b 100644 --- a/src/supernode/baseclientproxy.cpp +++ b/src/supernode/baseclientproxy.cpp @@ -49,6 +49,7 @@ void supernode::BaseClientProxy::Init() bool supernode::BaseClientProxy::GetWalletBalance(const supernode::rpc_command::GET_WALLET_BALANCE::request &in, supernode::rpc_command::GET_WALLET_BALANCE::response &out) { + LOG_PRINT_L0("BaseClientProxy::GetWalletBalance" << in.Account); std::unique_ptr wal = initWallet(base64_decode(in.Account), in.Password); if (!wal) { @@ -73,6 +74,7 @@ bool supernode::BaseClientProxy::GetWalletBalance(const supernode::rpc_command:: bool supernode::BaseClientProxy::CreateAccount(const supernode::rpc_command::CREATE_ACCOUNT::request &in, supernode::rpc_command::CREATE_ACCOUNT::response &out) { + LOG_PRINT_L0("BaseClientProxy::CreateAccount" << in.Language); std::vector languages; crypto::ElectrumWords::get_language_list(languages); std::vector::iterator it; @@ -115,6 +117,7 @@ bool supernode::BaseClientProxy::CreateAccount(const supernode::rpc_command::CRE bool supernode::BaseClientProxy::GetSeed(const supernode::rpc_command::GET_SEED::request &in, supernode::rpc_command::GET_SEED::response &out) { + LOG_PRINT_L0("BaseClientProxy::GetSeed" << in.Account); std::unique_ptr wal = initWallet(base64_decode(in.Account), in.Password); if (!wal) { @@ -131,6 +134,7 @@ bool supernode::BaseClientProxy::GetSeed(const supernode::rpc_command::GET_SEED: bool supernode::BaseClientProxy::RestoreAccount(const supernode::rpc_command::RESTORE_ACCOUNT::request &in, supernode::rpc_command::RESTORE_ACCOUNT::response &out) { + LOG_PRINT_L0("BaseClientProxy::RestoreAccount" << in.Seed); if (in.Seed.empty()) { out.Result = ERROR_ELECTRUM_SEED_EMPTY; diff --git a/src/supernode/main.cpp b/src/supernode/main.cpp index 811e70712..732eb381d 100644 --- a/src/supernode/main.cpp +++ b/src/supernode/main.cpp @@ -53,7 +53,7 @@ namespace supernode { int main(int argc, const char** argv) { mlog_configure("", true); - mlog_set_log_level(5); + mlog_set_log_level(0); string conf_file("conf.ini"); if(argc>1) conf_file = argv[1];