diff --git a/src/bitcoin-cli.cpp b/src/bitcoin-cli.cpp index aead9fb7a..d7c906669 100644 --- a/src/bitcoin-cli.cpp +++ b/src/bitcoin-cli.cpp @@ -73,7 +73,6 @@ public: #include "komodo_structs.h" #include "komodo_globals.h" -#include "cc/utils.h" #include "komodo_utils.h" #include "komodo_cJSON.c" #include "komodo_notary.h" diff --git a/src/rpcserver.h b/src/rpcserver.h index 372d84392..81ca8a8b9 100644 --- a/src/rpcserver.h +++ b/src/rpcserver.h @@ -287,9 +287,6 @@ extern UniValue FSMlist(const UniValue& params, bool fHelp); extern UniValue FSMinfo(const UniValue& params, bool fHelp); extern UniValue auctionaddress(const UniValue& params, bool fHelp); -extern bool pubkey2address(char *destaddr,uint8_t *pubkey33); -extern bool Getscriptaddress(char *destaddr,const CScript &scriptPubKey); - extern UniValue getnewaddress(const UniValue& params, bool fHelp); // in rpcwallet.cpp //extern UniValue getnewaddress64(const UniValue& params, bool fHelp); // in rpcwallet.cpp extern UniValue getaccountaddress(const UniValue& params, bool fHelp); diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp index bcd490915..fe21544dc 100644 --- a/src/wallet/rpcwallet.cpp +++ b/src/wallet/rpcwallet.cpp @@ -4991,11 +4991,7 @@ UniValue setpubkey(const UniValue& params, bool fHelp) + HelpExampleRpc("setpubkey", "02f7597468703c1c5c8465dd6d43acaae697df9df30bed21494d193412a1ea193e") ); -#ifdef ENABLE_WALLET LOCK2(cs_main, pwalletMain ? &pwalletMain->cs_wallet : NULL); -#else - LOCK2(cs_main); -#endif char Raddress[18]; uint8_t pubkey33[33]; @@ -5011,13 +5007,11 @@ UniValue setpubkey(const UniValue& params, bool fHelp) if (isValid) { CTxDestination dest = address.Get(); -#ifdef ENABLE_WALLET isminetype mine = pwalletMain ? IsMine(*pwalletMain, dest) : ISMINE_NO; if ( mine == ISMINE_NO ) { result.push_back(Pair("error", "privkey for this pubkey is not imported to wallet!")); } else { result.push_back(Pair("ismine", "true")); -#endif NOTARY_ADDRESS = address.ToString(); std::string notaryname; if ( (IS_STAKED_NOTARY= StakedNotaryID(notaryname, Raddress)) > -1 ) { diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index f21c23810..a340ecfae 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -1230,7 +1230,8 @@ bool CWallet::AddToWalletIfInvolvingMe(const CTransaction& tx, const CBlock* pbl } } // Now we know if it was a tx sent to us, that wasnt from ourself. - fprintf(stderr, "We sent from address: %s vouts: %d\n",NOTARY_ADDRESS.c_str(),numvinIsOurs); + if ( numvinIsOurs != 0 ) + fprintf(stderr, "We sent from address: %s vins: %d\n",NOTARY_ADDRESS.c_str(),numvinIsOurs); // Count vouts, check if OUR notary address is the receiver. if ( numvinIsOurs == 0 ) { for (size_t i = 0; i < tx.vout.size() ; i++) { @@ -1244,8 +1245,10 @@ bool CWallet::AddToWalletIfInvolvingMe(const CTransaction& tx, const CBlock* pbl } } // If no vouts are to the notary address we will ignore them. - if ( numvoutIsOurs == 0 ) + if ( numvoutIsOurs == 0 ) { + fprintf(stderr, "Received transaction to address other than notary address, ignored! \n"); return false; + } fprintf(stderr, "address: %s received %ld sats from %d vouts.\n",NOTARY_ADDRESS.c_str(),totalvoutvalue,numvoutIsOurs); // here we add calculation for number if vouts received, average size and determine if we accept them to wallet or not. int64_t avgVoutSize = totalvoutvalue / numvoutIsOurs; @@ -1254,10 +1257,9 @@ bool CWallet::AddToWalletIfInvolvingMe(const CTransaction& tx, const CBlock* pbl fprintf(stderr, "ignored: %d vouts average size of %ld sats.\n",numvoutIsOurs, avgVoutSize); return false; } - } else if ( numvinIsOurs < tx.vin.size() ) { - // this means we were in a multi sig, ideally we would remove the utxo we spent from our wallet, but you cant do that. - // this will be removed later... RPC call PurgeWalletSpents will be created instead. + // this means we were in a multi sig, ideally we would remove the utxo we spent from our wallet, but you cant do that, unless all the tx's vouts are also spent. + // RPC call PurgeWalletSpents will be created to clean all fully spent tx's instead. fprintf(stderr, "There are vins that are not ours, notarisation?\n"); } }