aboutsummaryrefslogtreecommitdiff
path: root/src/cryptonote_core (follow)
AgeCommit message (Collapse)AuthorFilesLines
2018-01-27Merge pull request #3144Riccardo Spagni2-1/+16
42f86624 rpc: expose recent median block size in getinfo (moneromooo-monero)
2018-01-27Merge pull request #3143Riccardo Spagni1-0/+6
ba6d2975 cryptonote_core: add --disable-dns-checkpoints flag (moneromooo-monero)
2018-01-26Update 2018 copyrightxmr-eric10-10/+10
2018-01-25Merge pull request #3014Riccardo Spagni1-1/+1
deeffaeb blockchain: remove minor floating point usage (moneromooo-monero)
2018-01-17rpc: expose recent median block size in getinfomoneromooo-monero2-1/+16
2018-01-17cryptonote_core: add --disable-dns-checkpoints flagmoneromooo-monero1-0/+6
2018-01-10blockchain: remove minor floating point usagemoneromooo-monero1-1/+1
2018-01-10Merge pull request #2971Riccardo Spagni3-11/+34
ae860230 Fix exceptions not finding txpool txes when relaying (moneromooo-monero)
2017-12-25Merge pull request #2929Riccardo Spagni1-5/+35
ae55bacd resumption support for updates using range requests (moneromooo-monero) fe0fae50 epee: add a get_file_size function (moneromooo-monero)
2017-12-20Fix exceptions not finding txpool txes when relayingmoneromooo-monero3-11/+34
2017-12-18cryptonote_core: remove unused functions with off by one bugsmoneromooo-monero4-105/+0
2017-12-18blockchain: don't leave dangling pointers in thismoneromooo-monero1-0/+2
2017-12-18cryptonote_core: fix db leak on errormoneromooo-monero2-2/+3
2017-12-18check accessing an element past the end of a containermoneromooo-monero2-4/+12
2017-12-18fix a few leaks by throwing objects, not newed pointers to objectsmoneromooo-monero1-1/+1
2017-12-17Merge pull request #2134Riccardo Spagni3-45/+90
ceabc4f9 change the N-1/N multisig second message signer for auth (moneromooo-monero) 55c2845d core_tests: multisig test now tests multiple inputs (moneromooo-monero) 98db7ee4 wallet: factor multisig info parsing (moneromooo-monero) 31a97e76 wallet: use raw encrypted data in multisig import/export RPC (moneromooo-monero) 2fa707d1 wallet: add multisig sign/submit RPC (moneromooo-monero) e36f5b60 Match surae's recommendation to derive multisig keys (moneromooo-monero) a36c261d wallet2: fix slow multisig unit tests with subaddress patch (moneromooo-monero) fa569712 make multisig work with subaddresses (moneromooo-monero) dffa0dce simplewallet: add export_raw_multisig command (moneromooo-monero) 7f4c220b simplewallet: add multisig to wallet type in wallet_info output (moneromooo-monero) 26529038 wallet: guard against partly initialized multisig wallet (moneromooo-monero) 66e34e85 add multisig core test and factor multisig building blocks (moneromooo-monero) f4eda44c N-1/N multisig (moneromooo-monero) cd64c799 multisig address generation RPC (moneromooo-monero) fff871a4 gen_multisig: generates multisig wallets if participants trust each other (moneromooo-monero) 95a21a79 wallet2: allow empty wallet filename to avoid saving data (moneromooo-monero) b84b3565 tests: add multisig unit tests (moneromooo-monero) 4c313324 Add N/N multisig tx generation and signing (moneromooo-monero) 6d219a92 wallet: add multisig key generation (moneromooo-monero)
2017-12-17cryptonote_core: fix blockchain init call after prototype changemoneromooo-monero1-1/+1
2017-12-17make multisig work with subaddressesmoneromooo-monero2-14/+9
Thanks to kenshi84 for help getting this work
2017-12-17add multisig core test and factor multisig building blocksmoneromooo-monero2-15/+2
2017-12-17Add N/N multisig tx generation and signingmoneromooo-monero2-44/+107
Scheme by luigi1111: Multisig for RingCT on Monero 2 of 2 User A (coordinator): Spendkey b,B Viewkey a,A (shared) User B: Spendkey c,C Viewkey a,A (shared) Public Address: C+B, A Both have their own watch only wallet via C+B, a A will coordinate spending process (though B could easily as well, coordinator is more needed for more participants) A and B watch for incoming outputs B creates "half" key images for discovered output D: I2_D = (Hs(aR)+c) * Hp(D) B also creates 1.5 random keypairs (one scalar and 2 pubkeys; one on base G and one on base Hp(D)) for each output, storing the scalar(k) (linked to D), and sending the pubkeys with I2_D. A also creates "half" key images: I1_D = (Hs(aR)+b) * Hp(D) Then I_D = I1_D + I2_D Having I_D allows A to check spent status of course, but more importantly allows A to actually build a transaction prefix (and thus transaction). A builds the transaction until most of the way through MLSAG_Gen, adding the 2 pubkeys (per input) provided with I2_D to his own generated ones where they are needed (secret row L, R). At this point, A has a mostly completed transaction (but with an invalid/incomplete signature). A sends over the tx and includes r, which allows B (with the recipient's address) to verify the destination and amount (by reconstructing the stealth address and decoding ecdhInfo). B then finishes the signature by computing ss[secret_index][0] = ss[secret_index][0] + k - cc[secret_index]*c (secret indices need to be passed as well). B can then broadcast the tx, or send it back to A for broadcasting. Once B has completed the signing (and verified the tx to be valid), he can add the full I_D to his cache, allowing him to verify spent status as well. NOTE: A and B *must* present key A and B to each other with a valid signature proving they know a and b respectively. Otherwise, trickery like the following becomes possible: A creates viewkey a,A, spendkey b,B, and sends a,A,B to B. B creates a fake key C = zG - B. B sends C back to A. The combined spendkey C+B then equals zG, allowing B to spend funds at any time! The signature fixes this, because B does not know a c corresponding to C (and thus can't produce a signature). 2 of 3 User A (coordinator) Shared viewkey a,A "spendkey" j,J User B "spendkey" k,K User C "spendkey" m,M A collects K and M from B and C B collects J and M from A and C C collects J and K from A and B A computes N = nG, n = Hs(jK) A computes O = oG, o = Hs(jM) B anc C compute P = pG, p = Hs(kM) || Hs(mK) B and C can also compute N and O respectively if they wish to be able to coordinate Address: N+O+P, A The rest follows as above. The coordinator possesses 2 of 3 needed keys; he can get the other needed part of the signature/key images from either of the other two. Alternatively, if secure communication exists between parties: A gives j to B B gives k to C C gives m to A Address: J+K+M, A 3 of 3 Identical to 2 of 2, except the coordinator must collect the key images from both of the others. The transaction must also be passed an additional hop: A -> B -> C (or A -> C -> B), who can then broadcast it or send it back to A. N-1 of N Generally the same as 2 of 3, except participants need to be arranged in a ring to pass their keys around (using either the secure or insecure method). For example (ignoring viewkey so letters line up): [4 of 5] User: spendkey A: a B: b C: c D: d E: e a -> B, b -> C, c -> D, d -> E, e -> A Order of signing does not matter, it just must reach n-1 users. A "remaining keys" list must be passed around with the transaction so the signers know if they should use 1 or both keys. Collecting key image parts becomes a little messy, but basically every wallet sends over both of their parts with a tag for each. Thia way the coordinating wallet can keep track of which images have been added and which wallet they come from. Reasoning: 1. The key images must be added only once (coordinator will get key images for key a from both A and B, he must add only one to get the proper key actual key image) 2. The coordinator must keep track of which helper pubkeys came from which wallet (discussed in 2 of 2 section). The coordinator must choose only one set to use, then include his choice in the "remaining keys" list so the other wallets know which of their keys to use. You can generalize it further to N-2 of N or even M of N, but I'm not sure there's legitimate demand to justify the complexity. It might also be straightforward enough to support with minimal changes from N-1 format. You basically just give each user additional keys for each additional "-1" you desire. N-2 would be 3 keys per user, N-3 4 keys, etc. The process is somewhat cumbersome: To create a N/N multisig wallet: - each participant creates a normal wallet - each participant runs "prepare_multisig", and sends the resulting string to every other participant - each participant runs "make_multisig N A B C D...", with N being the threshold and A B C D... being the strings received from other participants (the threshold must currently equal N) As txes are received, participants' wallets will need to synchronize so that those new outputs may be spent: - each participant runs "export_multisig FILENAME", and sends the FILENAME file to every other participant - each participant runs "import_multisig A B C D...", with A B C D... being the filenames received from other participants Then, a transaction may be initiated: - one of the participants runs "transfer ADDRESS AMOUNT" - this partly signed transaction will be written to the "multisig_monero_tx" file - the initiator sends this file to another participant - that other participant runs "sign_multisig multisig_monero_tx" - the resulting transaction is written to the "multisig_monero_tx" file again - if the threshold was not reached, the file must be sent to another participant, until enough have signed - the last participant to sign runs "submit_multisig multisig_monero_tx" to relay the transaction to the Monero network
2017-12-17Merge pull request #2877Riccardo Spagni2-13/+6
43f5269f Wallets now do not depend on the daemon rpc lib (moneromooo-monero) bb89ae8b move connection_basic and network_throttle from src/p2p to epee (moneromooo-monero) 4abf25f3 cryptonote_core does not depend on p2p anymore (moneromooo-monero)
2017-12-16cryptonote_core does not depend on p2p anymoremoneromooo-monero2-13/+6
As a followon side effect, this makes a lot of inline code included only in particular cpp files (and instanciated when necessary.
2017-12-16move includes around to lessen overall loadmoneromooo-monero3-1/+4
2017-12-16Merge pull request #2878Riccardo Spagni4-8/+35
abebe392 rpc: add offline state in info rpc (moneromooo-monero) 7696e849 core: make --offline also disable DNS lookups (moneromooo-monero)
2017-12-16Merge pull request #2871Riccardo Spagni1-2/+2
2b0a32f8 Small cleanup of daemon synchronization output (xmr-eric)
2017-12-15resumption support for updates using range requestsmoneromooo-monero1-5/+35
2017-12-09core: fix input ordering from v7moneromooo-monero1-1/+1
2017-12-08add bulletproofs from v7 on testnetmoneromooo-monero2-9/+44
2017-12-08integrate bulletproofs into moneromoneromooo-monero2-4/+4
2017-11-30core: make --offline also disable DNS lookupsmoneromooo-monero4-8/+35
2017-11-27Small cleanup of daemon synchronization outputxmr-eric1-2/+2
Add period to second sentence
2017-11-26Added command descriptionsCifrado1-0/+1
2017-11-25Merge pull request #2794Riccardo Spagni2-0/+34
43f27c7d core: warn when free disk space is low (moneromooo-monero)
2017-11-24wallet: transfer RPC can now return tx metadata (pending_tx)moneromooo-monero1-0/+14
2017-11-14Merge pull request #2692Riccardo Spagni1-10/+0
0f2c2d4c rpc: remove obsolete busy core checks (moneromooo-monero)
2017-11-14Merge pull request #2736Riccardo Spagni2-24/+96
0d9c0db9 Do not build against epee_readline if it was not built (Howard Chu) 178014c9 split off readline code into epee_readline (moneromooo-monero) a9e14a19 link against readline only for monerod and wallet-wallet-{rpc,cli} (moneromooo-monero) 437421ce wallet: move some scoped_message_writer calls from the libs (moneromooo-monero) e89994e9 wallet: rejig to avoid prompting in wallet2 (moneromooo-monero) ec5135e5 move input_line from command_line to simplewallet (moneromooo-monero) 082db75f move cryptonote command line options to cryptonote_core (moneromooo-monero)
2017-11-14rpc: remove obsolete busy core checksmoneromooo-monero1-10/+0
2017-11-14move cryptonote command line options to cryptonote_coremoneromooo-monero2-24/+96
Those have no reason to be in a generic module
2017-11-14remove "using namespace std" from headersmoneromooo-monero4-2/+8
It's nasty, and actually breaks on Solaris, where if.h fails to build due to: struct map *if_memmap;
2017-11-14Merge pull request #2681Riccardo Spagni1-7/+1
ec48e8d8 core: do not forbid txes without destination (moneromooo-monero) 523084bc core: don't add empty additional pub keys field to extra (moneromooo-monero)
2017-11-14Merge pull request #2675Riccardo Spagni1-6/+11
00cc1fdd subaddress: remove unneeded scalarmultBase (kenshi84)
2017-11-14Merge pull request #2615Riccardo Spagni6-46/+80
10013e94 Protect node privacy by proper filtering in restricted-mode RPC answers (binaryFate)
2017-11-14core: warn when free disk space is lowmoneromooo-monero2-0/+34
2017-11-08Protect node privacy by proper filtering in restricted-mode RPC answersbinaryFate6-46/+80
This patch allows to filter out sensitive information for queries that rely on the pool state, when running in restricted mode. This filtering is only applied to data sent back to RPC queries. Results of inline commands typed locally in the daemon are not affected. In practice, when running with `--restricted-rpc`: * get_transaction_pool will list relayed transactions with the fields "last relayed time" and "received time" set to zero. * get_transaction_pool will not list transaction that have do_not_relay set to true, and will not list key images that are used only for such transactions * get_transaction_pool_hashes.bin will not list such transaction * get_transaction_pool_stats will not count such transactions in any of the aggregated values that are computed The implementation does not make filtering the default, so developers should be mindful of this if they add new RPC functionality. Fixes #2590.
2017-11-06track double spending in the txpoolmoneromooo-monero3-8/+62
Transactions in the txpool are marked when another transaction is seen double spending one or more of its inputs. This is then exposed wherever appropriate. Note that being marked with this "double spend seen" flag does NOT mean this transaction IS a double spend and will never be mined: it just means that the network has seen at least another transaction spending at least one of the same inputs, so care should be taken to wait for a few confirmations before acting upon that transaction (ie, mostly of use for merchants wanting to accept unconfirmed transactions).
2017-11-03Merge pull request #2662Riccardo Spagni2-7/+7
88ebfd64 core_tests: fix for subaddress patch (kenshi84) e373a203 performance_tests: add master spend pubkey to subaddress hashtable (kenshi84)
2017-10-30blockchain: do not lock the blockchain lock for simple DB gettersmoneromooo-monero1-7/+28
It is safe in those cases, though might return slightly out of date information if another thread is busy modifying the blockchain, but it avoids potentially lengthy delays just to get things like the current blockchain height.
2017-10-19core: do not forbid txes without destinationmoneromooo-monero1-6/+0
This was spuriously forbidden in the recent subaddress patch, which isn't inherently incompatible with these.
2017-10-19core: don't add empty additional pub keys field to extramoneromooo-monero1-1/+1
Saves a couple bytes per tx
2017-10-18subaddress: remove unneeded scalarmultBasekenshi841-6/+11
2017-10-17core_tests: fix for subaddress patchkenshi842-7/+7
2017-10-15Merge pull request #2656Riccardo Spagni1-3/+3
3492de01 fix lightwallet and subaddresses conflict (Jaquee) 329f149e remove reference to cryptonote::null_hash (Jaquee)
2017-10-15remove reference to cryptonote::null_hashJaquee1-3/+3
2017-10-15Merge pull request #2640Riccardo Spagni1-2/+12
22b51e06 db_lmdb: include chain height when failing to find an output key (moneromooo-monero) 5db433b3 blockchain: avoid exceptions in output verification (moneromooo-monero)
2017-10-15Merge pull request #2638Riccardo Spagni1-1/+9
529a6a4a core: guard against a mined block not finding all txes in the pool (moneromooo-monero)
2017-10-15Merge pull request #2552Riccardo Spagni3-9/+28
69ce33f2 core: fix failure to sync when a tx is already in the pool (moneromooo-monero)
2017-10-15Merge pull request #2469Riccardo Spagni4-9/+133
7adceee6 precomputed block hashes are now in blocks of N (currently 256) (moneromooo-monero)
2017-10-12blockchain: avoid exceptions in output verificationmoneromooo-monero1-2/+12
This can happen if we get a bad tx, so let's not spam the log.
2017-10-11core: guard against a mined block not finding all txes in the poolmoneromooo-monero1-1/+9
This can happen for several reasons, but mainly if another block was received, which took that tx off the pool.
2017-10-07Subaddresseskenshi842-8/+115
2017-10-06Merge pull request #2540Riccardo Spagni1-1/+1
71c7f8d0 core: fix logging the one time public key on error (moneromooo-monero)
2017-10-06Merge pull request #2537Riccardo Spagni1-2/+2
269a2a01 blockchain: fix off by one getting blocks (moneromooo-monero)
2017-10-06Merge pull request #2534Riccardo Spagni2-37/+4
4e115a3a core: remove out sorting from v7 rules (moneromooo-monero)
2017-10-03construct_tx_and_get_tx_key: return sorted sources for print_ring_memebrs to ↵stoffu2-4/+4
work properly
2017-10-02Merge pull request #2513Riccardo Spagni1-1/+2
309290d1 Source updates are in a source subdirectory (moneromooo-monero)
2017-09-29core: fix failure to sync when a tx is already in the poolmoneromooo-monero3-9/+28
2017-09-27core: remove out sorting from v7 rulesmoneromooo-monero2-37/+4
and restore random shuffle of outputs This turned out to have a flaw (sort order depends on output index), and this doesn't really bring much anyway
2017-09-27core: fix logging the one time public key on errormoneromooo-monero1-1/+1
2017-09-27blockchain: fix off by one getting blocksmoneromooo-monero1-2/+2
2017-09-26Merge pull request #2533Riccardo Spagni1-0/+2
97cdd4c9 core: undo output sorting (moneromooo-monero)
2017-09-26core: undo output sortingmoneromooo-monero1-0/+2
It looks like it may be buggy
2017-09-25Merge pull request #2527Riccardo Spagni1-1/+2
ba6907f6 core: fix creation of v1 txes (moneromooo-monero)
2017-09-25core: fix creation of v1 txesmoneromooo-monero1-1/+2
2017-09-25checkpoints: add a token checkpoint on testnet (the genesis block)moneromooo-monero1-1/+1
2017-09-25fix typo in basic and core CMakeLists.txtmoneromooo-monero1-1/+1
2017-09-25move checkpoints in a separate librarymoneromooo-monero3-3/+2
2017-09-25Merge pull request #2458Riccardo Spagni1-1/+0
7f2f6ee1 protocol: remove hop count on block propagation (moneromooo-monero)
2017-09-25Merge pull request #2457Riccardo Spagni1-1/+10
d2d8a41c Use actual batch size for resize estimates (Howard Chu)
2017-09-25Merge pull request #2452Riccardo Spagni1-0/+1
0aaaca29 tx_pool: set the "invalid input" bit when check_tx_inputs fails (moneromooo-monero) 9236823b simplewallet: print tx rejection reason where it was missing (moneromooo-monero) 3dee3301 core_rpc_server: print tx rejection reason at L0 too (moneromooo-monero)
2017-09-25Merge pull request #2424Riccardo Spagni4-11/+10
28b72b6e tx_pool: pre-init tvc.m_verifivation_failed before processing (moneromooo-monero) 50a629b2 core_tests: catch (impossible in practice) tx extra api failure (moneromooo-monero) fee15ef1 wallet2: catch failure to parse address (moneromooo-monero) 1399e26d net_peerlist: remove dead code (moneromooo-monero) 50e09698 tx_pool: guard against failure getting tx hash (moneromooo-monero) 54cc209a wallet_rpc_server: catch failure to create directory (moneromooo-monero) 3e55099c wallet_rpc_server: init m_vm to NULL in ctor (moneromooo-monero) 7d0dde5e wallet_args: remove redundant default value for --log-file (moneromooo-monero) ed4a3350 wallet2: catch failure to save keys file (moneromooo-monero) 44434c8a wallet2_api: check whether dynamic_cast returns NULL (moneromooo-monero) 92f2f687 core: check return value from parse_hexstr_to_binbuff (moneromooo-monero) 5475692e wallet2_api: remove an unused, uninitialized, field (moneromooo-monero) a7ba3de1 libwallet_api_tests: initialize newblock_triggered on reset (moneromooo-monero) b2763ace wallet2_api: init error code to "no error" in the ctor (moneromooo-monero) b5faac53 get_blockchain_top now returns void (moneromooo-monero) 2e44d8f2 wallet_rpc_server: guard against exceptions (moneromooo-monero) 4230876b simplewallet: guard against I/O exceptions (moneromooo-monero) 06c1e057 daemon: initialize decode_as_json in RPC request (moneromooo-monero) 11f71af5 http_base: init size_t in http_request_info ctor (moneromooo-monero)
2017-09-25Merge pull request #2442Riccardo Spagni1-0/+1
e29282d2 build: auto update version info without manually deleting version.h (stoffu)
2017-09-25Merge pull request #2440Riccardo Spagni3-6/+71
6137a0b9 blockchain: reject unsorted ins and outs from v7 (moneromooo-monero) 16afab90 core: sort ins and outs key key image and public key, respectively (moneromooo-monero) 0c36b9f9 common: add apply_permutation file and function (moneromooo-monero)
2017-09-25tx_pool: pre-init tvc.m_verifivation_failed before processingmoneromooo-monero1-3/+3
CID 175316
2017-09-25tx_pool: guard against failure getting tx hashmoneromooo-monero1-1/+2
Should be impossible in practice, but easy change CID 175282
2017-09-25core: check return value from parse_hexstr_to_binbuffmoneromooo-monero1-2/+3
2017-09-25get_blockchain_top now returns voidmoneromooo-monero2-5/+2
It was always returning true, and could not be foreseen to usefully return errors in the future. This silences CID 162652 as well as saves some checking code in a few places.
2017-09-22Source updates are in a source subdirectorymoneromooo-monero1-1/+2
rather than in the same directory as the prebuilt versions
2017-09-21Merge pull request #2496Riccardo Spagni1-3/+23
3b8b4be5 tx_pool: drop invalid txes from the pool on startup (moneromooo-monero)
2017-09-21build: auto update version info without manually deleting version.hstoffu1-0/+1
2017-09-20tx_pool: drop invalid txes from the pool on startupmoneromooo-monero1-3/+23
instead of just failing This is a workaround for bad tx blobs being inserted in the pool for unknown reasons
2017-09-20blockchain: fix crash checking pre-validated txidsmoneromooo-monero1-2/+2
2017-09-18precomputed block hashes are now in blocks of N (currently 256)moneromooo-monero4-9/+133
This shaves a lot of space off binaries
2017-09-18Merge pull request #2446Riccardo Spagni3-97/+56
6d0ca7d1 Tweak concurrency limits (Howard Chu) 510d0d47 Use a threadpool (Howard Chu)
2017-09-18Merge pull request #2023Riccardo Spagni1-1/+1
f761dbae Remove 1.25x multiplier from tx_pool (Nano Akron)
2017-09-18Merge pull request #2044Riccardo Spagni6-74/+303
0299cb77 Fix various oversights/bugs in ZMQ RPC server code (Thomas Winget) 77986023 json serialization for rpc-relevant monero types (Thomas Winget) 5c1e08fe Refactor some things into more composable (smaller) functions (Thomas Winget) 9ac2ad07 DRY refactoring (Thomas Winget)
2017-09-18blockchain: reject unsorted ins and outs from v7moneromooo-monero1-0/+39
This ensures no information is leaked by the ordering
2017-09-17Use actual batch size for resize estimatesHoward Chu1-1/+10
And optimize import startup: Remember start_height position during initial count_blocks pass to avoid having to reread entire file again to arrive at start_height
2017-09-17protocol: remove hop count on block propagationmoneromooo-monero1-1/+0
It is unused, as it was apparently a future optimization, and it leaks some information (though since pools publish thei blocks they find, that amount seems small).
2017-09-16tx_pool: set the "invalid input" bit when check_tx_inputs failsmoneromooo-monero1-0/+1
2017-09-14Use a threadpoolHoward Chu3-97/+56
Instead of constantly creating and destroying threads
2017-09-14Remove 1.25x multiplier from tx_poolNano Akron1-1/+1
2017-09-14Merge pull request #2438Riccardo Spagni1-2/+18
9443eec1 core: guard against exceptions in tx verification worker threads (moneromooo-monero)
2017-09-14Merge pull request #2404Riccardo Spagni1-1/+1
e5238adf update checkpoint hashes (Riccardo Spagni) d4f56bdf update hardcoded checkpoints (Riccardo Spagni) ed730511 update checkpoints.dat (Riccardo Spagni)
2017-09-14Merge pull request #2396Riccardo Spagni1-1/+1
dbfef643 tx_pool: catch exceptions in LockedTXN dtor (moneromooo-monero)
2017-09-13core: sort ins and outs key key image and public key, respectivelymoneromooo-monero2-6/+32
This avoids leaking some small amount of information
2017-09-12core: guard against exceptions in tx verification worker threadsmoneromooo-monero1-2/+18
2017-09-06update checkpoint hashesRiccardo Spagni1-1/+1
2017-09-05json serialization for rpc-relevant monero typesThomas Winget5-1/+112
Structured {de-,}serialization methods for (many new) types which are used for requests or responses in the RPC. New types include RPC requests and responses, and structs which compose types within those. # Conflicts: # src/cryptonote_core/blockchain.cpp
2017-09-05Refactor some things into more composable (smaller) functionsThomas Winget2-73/+179
This commit refactors some of the rpc-related functions in the Blockchain class to be more composable. This change was made in order to make implementing the new zmq rpc easier without trampling on the old rpc. New functions: Blockchain::get_num_mature_outputs Blockchain::get_random_outputs Blockchain::get_output_key Blockchain::get_output_key_mask_unlocked Blockchain::find_blockchain_supplement (overload) functions which previously had this functionality inline now call these functions as necessary.
2017-09-04tx_pool: catch exceptions in LockedTXN dtormoneromooo-monero1-1/+1
This might prevent some calls to terminate when the LockedTXN dtor is called as part of stack unwinding caused by another exception in the first place.
2017-09-03Add a --fluffy-blocks option to relay blocks as fluffy blocksmoneromooo-monero2-0/+11
Defaults to off, but fluffy blocks are forced enabled on testnet
2017-09-02Merge pull request #2374Riccardo Spagni1-0/+3
e72e625e tx_pool: wrap tx meta updates in a LockedTXN (moneromooo-monero)
2017-09-02Merge pull request #2372Riccardo Spagni2-5/+25
c867357a cryptonote_protocol: error handling on cleanup_handle_incoming_blocks (moneromooo-monero) ce901fcb Fix blockchain_import wedge on exception in cleanup_handle_incoming_blocks (moneromooo-monero) 84fa015e core: guard against exceptions in handle_incoming_{block,tx} (moneromooo-monero)
2017-08-31DRY refactoringThomas Winget2-1/+13
2017-08-29tx_pool: wrap tx meta updates in a LockedTXNmoneromooo-monero1-0/+3
2017-08-29Fix blockchain_import wedge on exception in cleanup_handle_incoming_blocksmoneromooo-monero2-5/+17
2017-08-29core: guard against exceptions in handle_incoming_{block,tx}moneromooo-monero1-0/+8
When one happens, cleanup must be called or the incoming tx lock will stay locked
2017-08-29move db specific options to BlockchainDBmoneromooo-monero1-6/+4
Avoids common depending on blockchain_db, which can cause link errors.
2017-08-27Merge pull request #2349Riccardo Spagni1-2/+20
1914c999 txpool: update db tx metadata when it changes (moneromooo) 4dbf29bd txpool: add tx size median to the pool stats (moneromooo)
2017-08-27Merge pull request #2347Riccardo Spagni1-2/+7
5807529e blockchain: cap memory size of retrieved blocks (moneromooo-monero) c1b10381 rpc: decrease memory usage a bit in getblocks.bin (moneromooo-monero)
2017-08-26Merge pull request #2314Riccardo Spagni4-2/+42
c22d22e2 Cleanup test impact of adding safesyncmode() method (Howard Chu) 9a859844 Toggle SAFE syncmode on and off automatically (Howard Chu)
2017-08-26Merge pull request #2313Riccardo Spagni1-23/+7
3dd34a49 Cleanup test impact of moving blockchain_db_types() (Howard Chu) 80344740 More DB support cleanup (Howard Chu) 4c7f8ac0 DB cleanup (Howard Chu)
2017-08-26blockchain: cap memory size of retrieved blocksmoneromooo-monero1-2/+7
It helps keep memory usage down when a wallet refreshes through a string of large blocks
2017-08-26rpc: add a new RPC to get current txpool backlog (sizes and fees)moneromooo-monero4-0/+31
2017-08-25txpool: update db tx metadata when it changesmoneromooo1-1/+15
2017-08-25txpool: add tx size median to the pool statsmoneromooo1-1/+5
2017-08-25Merge pull request #2330Riccardo Spagni1-1/+1
ea15e72d tx_pool: fix crash in stats (Howard Chu)
2017-08-23tx_pool: fix crash in statsHoward Chu1-1/+1
if tx receive_time == now. supersedes #2322
2017-08-22Cleanup test impact of adding safesyncmode() methodHoward Chu2-0/+12
2017-08-20Toggle SAFE syncmode on and off automaticallyHoward Chu3-2/+30
If monerod is started with default sync mode, set it to SAFE after synchronization completes. Set it back to FAST if synchronization restarts (e.g. because another peer has a longer blockchain). If monerod is started with an explicit sync mode, none of this automation takes effect.
2017-08-19DB cleanupHoward Chu1-23/+7
Hide LMDB-specific stuff behind blockchain_db.h. Nobody besides blockchain_db.cpp should ever be including DB-specific headers any more.
2017-08-18core: add mainnet v6 fork height at 1400000moneromooo-monero1-0/+3
2017-08-17Merge pull request #2303Riccardo Spagni2-3/+11
5a283078 cryptonote_protocol: large block sync size before v4 (moneromooo-monero) 7b747607 cryptonote_protocol: kick idle synchronizing peers (moneromooo-monero)
2017-08-17Merge pull request #2287Riccardo Spagni4-0/+23
827afcb7 protocol: pass blockchain cumulative difficulty when syncing (moneromooo-monero)
2017-08-17cryptonote_protocol: large block sync size before v4moneromooo-monero2-3/+11
2017-08-15protocol: pass blockchain cumulative difficulty when syncingmoneromooo-monero4-0/+23
Not used yet.
2017-08-15Merge pull request #2288Riccardo Spagni1-0/+7
c6e200a8 core: add --db-salvage command line flag (moneromooo-monero)
2017-08-15Merge pull request #2276Riccardo Spagni2-0/+24
a1891ebe tests: fix tests build (moneromooo-monero)
2017-08-15Merge pull request #2250Riccardo Spagni1-1/+3
f4f7eeba blockchain: log more info when we reject an orphan (moneromooo-monero)
2017-08-15Merge pull request #2246Riccardo Spagni2-14/+4
d732c73e blockchain: remove a few unused variables (moneromooo-monero)
2017-08-15Merge pull request #2237Riccardo Spagni1-8/+8
5d4ef719 core: speed up output index unique set calculation (moneromooo-monero) 19d7f568 perf_timer: allow profiling more granular than millisecond (moneromooo-monero) bda8c598 epee: add nanosecond timer and pause/restart profiling macros (moneromooo-monero)
2017-08-12core: add --db-salvage command line flagmoneromooo-monero1-0/+7
Use to load the database when the primary meta page is corrupted
2017-08-10tests: fix tests buildmoneromooo-monero2-0/+24
Add get_fork_version and add_ideal_fork_version to core so cryptonote_protocol does not have to need the Blockchain class directly, as it's not in its dependencies, and add those to the fake core classes in tests too.
2017-08-09protocol: add checks for top block hard fork versionmoneromooo-monero1-0/+9
We won't even talk to a peer which claims a wrong version for its top block. This will avoid syncing to known bad peers in the first place. Also add IP fails when failing to verify a block.
2017-08-07Merge pull request #2231Riccardo Spagni2-7/+7
61770ec2 change mixin to ring size in user visible places (moneromooo-monero)
2017-08-07change mixin to ring size in user visible placesmoneromooo-monero2-7/+7
2017-08-07Merge pull request #2262Riccardo Spagni1-1/+1
7f7d42f8 core: fix invalid memory access creating tx (moneromooo-monero)
2017-08-07Merge pull request #2225Riccardo Spagni3-1/+17
5d91b26c blockchain: skip checking tx semantics in embedded block hash range (moneromooo-monero)
2017-08-07core: fix invalid memory access creating txmoneromooo-monero1-1/+1
2017-08-07core: new API to disable DNS checkpoint lookupsmoneromooo-monero2-1/+10
2017-08-07Merge pull request #2149Riccardo Spagni2-25/+104
158c3ecf core: thread most of handle_incoming_tx (moneromooo-monero) f57ee382 cryptonote_protocol: retry stale spans early (moneromooo-monero) 90df52e1 cryptonote_protocol: light cleanup (moneromooo-monero) 84e23156 cryptonote_protocol: avoid spurious SYNCHRONIZED OK messages (moneromooo-monero) 5be43fcd cryptonote_protocol_handler: sync speedup (moneromooo-monero)
2017-08-07Merge pull request #2243Riccardo Spagni1-0/+2
4d873046 blockchain: add testnet v6 fork height at 971400 (moneromooo-monero)
2017-08-07Merge pull request #2234Riccardo Spagni1-0/+1
214fd81e some include cleanup (moneromooo-monero)
2017-08-07Merge pull request #2230Riccardo Spagni1-0/+2
5dd722be core: add a message when loading checkpoints at init time (moneromooo-monero)
2017-08-07Merge pull request #2226Riccardo Spagni1-1/+0
14ec6ed8 tx_pool: remove obsolete unused m_config_folder field (moneromooo-monero)
2017-08-07Merge pull request #2222Riccardo Spagni1-1/+2
878205f1 core: fix lock ordering bug at init time (moneromooo-monero)
2017-08-07Merge pull request #2216Riccardo Spagni2-7/+7
d8becf2e blockchain: fix cryptonight buffer leak on exit (moneromooo-monero) 91aa90fc blockchain: ensure all blocks get their longhash precalculated (moneromooo-monero) ff4bcaed blockchain: pass correct height to get_block_longhash (moneromooo-monero)
2017-08-07Merge pull request #2206Riccardo Spagni1-1/+1
340feede core: randomly shuffle outputs (moneromooo-monero)
2017-08-07Merge pull request #2198Riccardo Spagni1-0/+14
53af9768 blockchain: one off warning when seeing a block with unknown version (moneromooo-monero)
2017-08-07blockchain: add testnet v6 fork height at 971400moneromooo-monero1-0/+2
2017-08-07core: thread most of handle_incoming_txmoneromooo-monero2-25/+104
2017-08-04blockchain: log more info when we reject an orphanmoneromooo-monero1-1/+3
We want to know what happened when a block is wrongly rejected
2017-08-03blockchain: remove a few unused variablesmoneromooo-monero2-14/+4
2017-08-01core: speed up output index unique set calculationmoneromooo-monero1-8/+8
A sort+uniq step was done for every tx in a 200 block chunk, causing a lot of repeated scanning as the size of the offset map got larger with every added tx. We now do the step only once at the end of the loop. Doing it this way potentially uses more memory, but testing shows that it's currently only about 2% more.
2017-07-31some include cleanupmoneromooo-monero1-0/+1
2017-07-31core: add a message when loading checkpoints at init timemoneromooo-monero1-0/+2
This uses DNS, which can take a while, so it's useful to know this is the culprit when loading pauses
2017-07-30tx_pool: remove obsolete unused m_config_folder fieldmoneromooo-monero1-1/+0
2017-07-30blockchain: skip checking tx semantics in embedded block hash rangemoneromooo-monero3-1/+17
If the txes are bad, this'll be picked up by the block hash mismatch since the tx merkle root is part of the block hash.
2017-07-29core: fix lock ordering bug at init timemoneromooo-monero1-1/+2
2017-07-28blockchain: fix cryptonight buffer leak on exitmoneromooo-monero1-1/+1
2017-07-27blockchain: ensure all blocks get their longhash precalculatedmoneromooo-monero2-2/+4
If the number of blocks to check was not a multiple of the number of preparation threads, the last few blocks would not be included in the threaded long hash calculation. Those would still get calculated when the block gets added to the chain, however, so this was only a tiny performance hit, rather than a security bug.
2017-07-27blockchain: pass correct height to get_block_longhashmoneromooo-monero1-4/+2
2017-07-25core: randomly shuffle outputsmoneromooo-monero1-1/+1
They used to be sorted by amount, which was fine before rct, but is now suboptimal, since amounts are not known anymore. In particular, it would give a recipient knowledge of whether change was higher or lower than the amount received.
2017-07-24blockchain: one off warning when seeing a block with unknown versionmoneromooo-monero1-0/+14
2017-07-22core: forbid duplicate ring members from v6moneromooo-monero2-0/+31
This avoids someone adding what amounts to mixin 0 rings in practice, as there is no other good reason to allow this.
2017-07-19Merge pull request #2142Riccardo Spagni2-0/+3
02d66db4 tx_pool: initialize padding in txpool meta structure (moneromooo-monero) 0722aea3 cryptonote_core: initialize checkpoint flag (moneromooo-monero)
2017-07-02tx_pool: initialize padding in txpool meta structuremoneromooo-monero1-0/+2
2017-07-02cryptonote_core: initialize checkpoint flagmoneromooo-monero1-0/+1
2017-06-23Fix mismatch of parameter name between header file and implementation for ↵Julien Klepatch1-3/+2
set_user_options()
2017-06-18Merge pull request #2082Riccardo Spagni3-2/+7
235df7f4 blockchain_db: add a txpool tx getter which returns existence (moneromooo-monero)
2017-06-11blockchain_db: add a txpool tx getter which returns existencemoneromooo-monero3-2/+7
Avoids exception spam for the "nope, not found" case
2017-06-04Add histogram to poolstatsHoward Chu1-1/+47
2017-06-01Merge pull request #2063Riccardo Spagni3-7/+12
d17c0fc2 Don't copy blockchain for coinbase_tx_sum (Howard Chu)
2017-06-01Merge pull request #2062Riccardo Spagni1-0/+5
31417d57 tx_pool: add missing blockchain lock in add_tx (moneromooo-monero)
2017-06-01Speedup print_pool_statsHoward Chu4-0/+45
Since we're just counting txs, there's no reason to deserialize all the blobs.
2017-06-01Don't copy blockchain for coinbase_tx_sumHoward Chu3-7/+12
Changed Blockchain::for_all_blocks() to for_blocks_range() Operate on blockchain in-place instead of building a copy first.
2017-05-31tx_pool: add missing blockchain lock in add_txmoneromooo-monero1-0/+5
2017-05-30Merge pull request #2039Riccardo Spagni1-1/+1
4b932ff3 changed crypto to cncrypto so it generated libcncrypto (Gentian)
2017-05-30Merge pull request #2026Riccardo Spagni1-1/+1
a5739201 Update sync time copy (xmr-eric)
2017-05-30Merge pull request #1982Riccardo Spagni6-278/+484
b52abd13 Move txpool to the database (moneromooo-monero)
2017-05-25Move txpool to the databasemoneromooo-monero6-278/+484
Integration could go further (ie, return_tx_to_pool calls should not be needed anymore, possibly other things). poolstate.bin is now obsolete.
2017-05-23changed crypto to cncrypto so it generated libcncryptoGentian1-1/+1
fix a cmakelist
2017-05-10Update sync time copyxmr-eric1-1/+1
2017-04-24Merge pull request #1968Riccardo Spagni1-1/+3
5e5b8512 Fix obsolete OpenSSL API usage (hyc) 6c72d6a0 Fix Android recognition (hyc) e65d66fe Fix ARM64 identification (hyc) a4673218 Clean up ARMv8-a aes_expand_key() (hyc) a3d77901 Fix block_longhash_worker thread (hyc)
2017-04-19Add expected total reward to RPC "getblocktemplate".assylias6-8/+11
Only works from V5 fork onward - returns 0 before that block.
2017-04-12Fix block_longhash_worker threadhyc1-1/+3
Wasn't getting its stack size initialized; crashes on Android with a default stack size of 1MB.
2017-04-04tx_pool: add blob size and fee/byte when logging a new txmoneromooo-monero1-1/+1
2017-03-25Merge pull request #1924Riccardo Spagni1-3/+3
6d315459 core: avoid possible reordering bugs wth tx/bloch hash cache (moneromooo-monero)
2017-03-25core: avoid possible reordering bugs wth tx/bloch hash cachemoneromooo-monero1-3/+3
2017-03-24Fixed typo in v5 hard fork finalized dateDerek Zhang1-1/+1