about summary refs log tree commit diff stats
path: root/pcoin.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Improving messaging around messageslogin2019-11-261-6/+53
| | | | The title is confusing, sorry. "No messages found" is shown in tcoin and pcoin when no messages are found (and this no-message message has one newline above and one newline below it instead of two newlines above it as before).
* Improving the messaging around sending transaction messageslogin2019-11-151-12/+52
| | | | | | | | | | | Several changes were made that were difficult to separate into separate commits. Since features are directly committed to master, there are no feature branches. The high-level list of changes is as follows: 1. Fixed a bug in pcoin where using "pcoin send -s" for silentsend would forget to add the transaction message that provides a record of who transferred how much and when, even if there is no custom message appended (send_message(.) was not called). 2. Improved the help text to make it clear that sending messages could be done using silentsend too. 3. In several cases in tcoin and pcoin, certain ways of doing a silentsend would still send with verbose output because, by mistake, the option passed to send_message(.) was not changed from "verbose" to "silent". 4. In pcoin, there was the case of 6 arguments missing, where one does pcoin send -s <user> <amount> <message>. This case was handled in tcoin but not pcoin. Now, it is handled in pcoin too. 5. Now, when a custom message is sent in tcoin or pcoin, an additional text confirming the successful sending of the custom message as distinct from the one confirming the sending of the coins is displayed to the user.
* KROWBAR_OFF, DA_OFF and MINERCOIN_OFF are now treated as config definitions~login@aussies.space2019-11-141-4/+0
| | | | | | The KROWBAR_OFF, DA_OFF and MINERCOIN_OFF symbolic constants are now included in tcoin_defs.cpp and pcoin_defs.cpp and have been removed from the main source files, tcoin.cpp and pcoin.cpp. ntcoin has been modified to include #define KROWBAR_OFF, #define DA_OFF and #define MINERCOIN_OFF in pcoin_defs.cpp and tcoin_defs.cpp by default, since those three features are only (as of now) available on the tilde.town server and on no other server.
* Bugfix to disable minercoin-score addition in pcoin.cpp~login@aussies.space2019-11-141-1/+1
| | | | | | In pcoin.cpp, minercoin-score addition can be disabled by writing #define MINERCOIN_OFF near the symbolic-constant definitions. However, in one place, a check for the absence of the DA_OFF symbolic constant was being made instead of MINERCOIN_OFF. This is now fixed.
* Creates separate definition files for tcoin.cpp and pcoin.cpp~login@aussies.space2019-11-141-13/+1
| | | | | | I realised that different tilde servers will have different definitions but the same code otherwise, and 'git push' and 'git pull' to update the code on other servers would override those definitions. Thus, the tcoin.cpp and pcoin.cpp files now look the same for all tildeservers and have a #include "tcoin_defs.cpp" and #include "pcoin_defs.cpp" respectively. The configuration, which is in the form of #define symbolic constants, is stored in tcoin/bin/tcoin_defs.cpp and tcoin/bin/pcoin_defs.cpp. ntcoin is modified to create these two files with the right definitions. ntcoin is also modified so that compile_tcoin and compile_pcoin now include the -I option, which instructs the compiler to look for includes in additional directories, in this case, tcoin/bin .
* Fixing a bug with how time is calculated for messages~login@aussies.space2019-10-071-6/+5
| | | | Benjamin Harris (https://ben.tild3.org, https://github.com/benharri, and https://benharr.is) found a bug where the time recorded for transaction logs/messages was local server time instead of UTC. It should have been UTC no matter what the local time was.
* Fixing preprocessor constants~login@aussies.space2019-10-071-1/+1
| | | | To fix the preprocessor constants so that they point to the right directory for the tcoin and pcoin executables. This will be different depending on where the tcoin and pcoin executables are stored.
* Added symbolic constants (flags) to remove integrations~login@aussies.space2019-09-301-4/+19
| | | | Since not all places where tcoin runs have tildebot, minerbot and daily-adventure, these integrations are now disabled in the code through preprocessor directives (symbolic constants that act as flags)
* Fixed preprocessor directives for pcoin.cpp and tcoin.cpp~login@aussies.space2019-09-301-0/+18
| | | | pcoin.cpp and tcoin.cpp were missing the preprocessor directives generated by ntcoin. The right preprocessor directives are now included in both files.
* Removed redundant code in pcoin.cpplogin0002019-07-151-2/+0
| | | pcoin.cpp had redundant code in 'int main()', where user_amount was redeclared (and thus became a local variable that shadowed the global version inside 'int main()' (!). Fixed by removing the redeclared, redundant line.
* Added #define DEBUG, fixed pcoin error messagelogin0002019-06-251-7/+13
| | | | Added #define DEBUG and put a few check statements under it. Fixed error message in pcoin that suggested the incorrect "add_internal_balance" amount when "internal_balance" owed to a particular user was not enough (and was lesser than the number of tildecoins being sent using the "send" command to said user). Also, fixed an error in retrieving the amount owed to a particular user when doing checks during the "send" command ("temp_program_sender_username" instead of "program_sender_username").
* Fixing daily-adventure integration in pcoin.cpplogin0002019-04-181-1/+1
| | | daily-adventure changed how it stores state, so this new code fixes daily-adventure integration to the new format that daily-adventure stores state in.
* Copied pcoin.cpp from tilde.townlogin0002019-03-101-0/+1796