Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Random100 #116

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/alert.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ bool CAlert::Cancels(const CAlert& alert) const
bool CAlert::AppliesTo(int nVersion, std::string strSubVerIn) const
{
// TODO: rework for client-version-embedded-in-strSubVer ?
// junk comment
return (IsInEffect() &&
nMinVer <= nVersion && nVersion <= nMaxVer &&
(setSubVer.empty() || setSubVer.count(strSubVerIn)));
Expand Down
3 changes: 3 additions & 0 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
// Copyright (c) 2009-2014 The Bitcoin developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
// junk comment line 3
// junk comment line 4
// junk comment line 5

#include "main.h"

Expand Down
10 changes: 10 additions & 0 deletions src/rpcserver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,15 @@ Value stop(const Array& params, bool fHelp)
return "Smileycoin server stopping";
}

Value random100(const Array& params, bool fHelp)
{
if (fHelp || params.size() > 1)
throw runtime_error(
"random100\n"
"\nGives a random number from 1-100");
int rando = rand() % 100 + 1;
return rando;
}


//
Expand All @@ -227,6 +236,7 @@ static const CRPCCommand vRPCCommands[] =
{ "getinfo", &getinfo, true, false, false }, /* uses wallet if enabled */
{ "help", &help, true, true, false },
{ "stop", &stop, true, true, false },
{ "random100", &random100, true, true, false },

/* P2P networking */
{ "getnetworkinfo", &getnetworkinfo, true, false, false },
Expand Down
2 changes: 2 additions & 0 deletions src/wallet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ bool bSpendZeroConfChange = true;
//
// mapWallet
//
// junk comment line
// junk comment line 2

struct CompareValueOnly
{
Expand Down