Skip to content

Commit

Permalink
Added command line parser, fixed prune chains, verify post limits
Browse files Browse the repository at this point in the history
  • Loading branch information
dgski committed Feb 2, 2018
1 parent 9af7306 commit 9484ea9
Show file tree
Hide file tree
Showing 30 changed files with 365 additions and 215 deletions.
1 change: 0 additions & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/node",
"args": ["ipc:///tmp/pipeline_11.ipc"],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [],
Expand Down
23 changes: 0 additions & 23 deletions Untitled-1

This file was deleted.

2 changes: 1 addition & 1 deletion blockchain.c
Original file line number Diff line number Diff line change
Expand Up @@ -682,7 +682,7 @@ bool valid_proof(char* last_hash, char* trans_hash, long proof) {
hash256(hash_value,guess);

if(1)
return (hash_value[0] == '0' && hash_value[1] == '0' /*&& hash_value[2] == '0' && (hash_value[3] > 60 && hash_value[3] < 127)*/);
return (hash_value[0] == '0' && hash_value[1] == '0' && hash_value[2] == '0' /*&& (hash_value[3] > 60 && hash_value[3] < 127)*/);
else
return (hash_value[0] == '0' && hash_value[1] == '0' && hash_value[2] == '0' && (hash_value[3] > 60 && hash_value[3] < 127));

Expand Down
2 changes: 2 additions & 0 deletions blockchain.h
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,8 @@ int extract_transactions_raw(transaction* trans_array, char* in_trans);

int extract_posts_raw(post* post_array, char* input_posts_string);
int validate_posts(blockchain* in_chain, post* new_post_array, int nr_of_posts);
int verify_post_format(const char* post);



//Transaction functions
Expand Down
Binary file modified client
Binary file not shown.
20 changes: 0 additions & 20 deletions client.dSYM/Contents/Info.plist

This file was deleted.

Binary file removed client.dSYM/Contents/Resources/DWARF/client
Binary file not shown.
50 changes: 25 additions & 25 deletions client_pri.pem
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
-----BEGIN RSA PRIVATE KEY-----
MIIEowIBAAKCAQEAmTJbErc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12 changes: 6 additions & 6 deletions client_pub.pem
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
-----BEGIN RSA PUBLIC KEY-----
MIIBCgKCAQEAmTJbErcNRisXj3haZFI3f4y/+kfkIwR+oU7VhlXMyxN6aEHvBhAM
87F2/a7ShlIr+G4wOj77LiNfrBzWeZ3wg0KvjIEs+7Fl3JXfOOGQU5I71Eb/+rFg
DAM6r5FLXSdAlfePho+jkAVeqJF+3ivb/gGmrPNMhjwAyhC021D7MKfMolBsMOVN
7EJ0GxgzMX4sEDEjnlXVxZR41hi3nMV7rn0mSiZbd92Su0N5B8fkjSaQTvA//dkt
bQWJM37GHvJnjd3zUZ2qGak1fx0ezJvAEUFxG2H37VFd1v9EdY2S9HrRVIqMkEn7
ev0FIyXxDDFGc6ZtWR2l4Ou9PuOw5V0U2QIDAP//
MIIBCgKCAQEA0jw12crrw4wWXMEE1UwbY1rPUgKUxpqg2NZgbyKUVsifzDrIk8fK
DYpS/vX//cSXVftTbe1DhFDbl43CBGNPiekcVmQFyC7PWPjY+8M5QxCjvKNhzQpa
3SMEI3M8jo9F5dtIc635sTe//CK7I03yXT7DHwDtqMerPn7C9ItiSPbJdjFGapjl
BPGJVjE42sV45gCUZPB5MgyTNX3hvMomYqqH6HERbw/l2fgzKbQ8KaPEupCgUHdv
SkA8XsaWqMCrYjIkUtMU9gN66McB7dTwSDskIkKFHV6lBGmHx/qfvSMOsNGFfE1l
Eog3nPP9ozimMW4ApP+zyH3/epALVpnAKwIDAP//
-----END RSA PUBLIC KEY-----
Binary file modified node
Binary file not shown.
Loading

0 comments on commit 9484ea9

Please sign in to comment.