Commit Graph

144 Commits

Author SHA1 Message Date
luigi1111 5cade94189
Merge pull request #4047
41b4bf9 tx_pool: cache check_tx_inputs results (moneromooo-monero)
2018-07-19 14:02:20 -05:00
luigi1111 a844844cda
Merge pull request #3716
a2b557f 6795bd0 209ec96 ed2c81e a830db2 57ea902 31a895e ba8331c f7f1917 41be339 f025ae9 ef2cb63 dcfd299 5d3e702 2704624 2771a18 0e4c7d0 (moneromooo-monero)
2018-06-27 15:33:01 -05:00
moneromooo-monero ed2c81ed95
replace std::list with std::vector on some hot paths
also use reserve where appropriate
2018-06-26 22:14:21 +01:00
luigi1111 c3ec5373b3
Merge pull request #3936
d81e042 tx_pool: initialize bitflags padding since it gets written to storage (moneromooo-monero)
2018-06-25 14:53:27 -05:00
moneromooo-monero 41b4bf9d6d
tx_pool: cache check_tx_inputs results
This is called a lot when creating a block template, and
does not change until the blockchain changes.
This also avoids tx parsing when cached.
2018-06-24 11:22:26 +01:00
moneromooo-monero d81e042306
tx_pool: initialize bitflags padding since it gets written to storage
Avoids valgrind reporting uninitialized data usage
2018-06-05 20:26:44 +01:00
moneromooo-monero 2b0c632f32
tx_pool: hold off parsing a tx blob till we actually need it 2018-06-02 09:17:41 +01:00
stoffu a6b8d3fee1
tx_pool: remove old comment from fill_block_template() 2018-05-28 13:41:39 +09:00
moneromooo-monero 08343abaf4
tx_pool: fix loading with colliding key images
A key image may be present more than once if all but one of the
txes spending that key image are coming from blocks. When loading
a txpool from storage, we must load the one that's not from a
block first to avoid rejection
2018-04-11 15:27:56 +01:00
Dimitris Apostolou 57c0b1ed9f Fix typos in various files 2018-03-15 18:25:38 +02:00
Leon Klingele 7c1a607c40
txpool: Don't bail out when blob_size == tx_size_limit
Previously, when blob_size == tx_size_limit, the "m_too_big" property was set
and the transaction was rejected. This should not have been the case.
2018-02-16 16:27:08 +01:00
Riccardo Spagni bfddb2283b
Merge pull request #3210
39992134 txpool: Properly bail out when outputs_amount == inputs_amount (Leon Klingele)
2018-02-16 14:22:10 +01:00
moneromooo-monero bc61ae69bf
tx_pool: add a max pool size, settable with --max-txpool-size 2018-02-07 13:42:12 +00:00
Leon Klingele 399921347f
txpool: Properly bail out when outputs_amount == inputs_amount
Previously, when outputs_amount == inputs_amount, the "m_overspend" property
was set, whereas "m_fee_too_low" would have been the correct property to set.

This is unlikely to ever occur and just something I've noticed while reading
through the code.
2018-02-01 00:48:45 +01:00
xmr-eric 18216f19dd Update 2018 copyright 2018-01-26 10:03:20 -05:00
moneromooo-monero ae8602303a
Fix exceptions not finding txpool txes when relaying 2017-12-20 13:02:53 +00:00
moneromooo-monero 383ff4f689
remove "using namespace std" from headers
It's nasty, and actually breaks on Solaris, where if.h fails to
build due to:

  struct map *if_memmap;
2017-11-14 16:56:10 +00:00
Riccardo Spagni fd0740e5e7
Merge pull request #2615
10013e94 Protect node privacy by proper filtering in restricted-mode RPC answers (binaryFate)
2017-11-14 14:53:10 +02:00
binaryFate 10013e9434 Protect node privacy by proper filtering in restricted-mode RPC answers
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-08 13:07:07 +01:00
moneromooo-monero ccf53a566c
track double spending in the txpool
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-06 00:05:44 +00:00
Riccardo Spagni 0e74777071
Merge pull request #2452
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-25 16:53:07 +02:00
moneromooo-monero 28b72b6ecc
tx_pool: pre-init tvc.m_verifivation_failed before processing
CID 175316
2017-09-25 15:48:59 +01:00
moneromooo-monero 50e096987b
tx_pool: guard against failure getting tx hash
Should be impossible in practice, but easy change

CID 175282
2017-09-25 15:48:42 +01:00
moneromooo-monero 3b8b4be5cb
tx_pool: drop invalid txes from the pool on startup
instead of just failing

This is a workaround for bad tx blobs being inserted in the
pool for unknown reasons
2017-09-20 18:55:16 +01:00
Riccardo Spagni 69e039aa19
Merge pull request #2023
f761dbae Remove 1.25x multiplier from tx_pool (Nano Akron)
2017-09-18 13:11:57 +02:00
Riccardo Spagni 591e53445b
Merge pull request #2044
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-18 13:08:16 +02:00
moneromooo-monero 0aaaca29a2
tx_pool: set the "invalid input" bit when check_tx_inputs fails 2017-09-16 11:27:52 +01:00
Nano Akron f761dbaeaf Remove 1.25x multiplier from tx_pool 2017-09-14 21:26:19 +01:00
Thomas Winget 77986023c3
json serialization for rpc-relevant monero types
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-05 12:20:27 -04:00
moneromooo-monero dbfef643ed
tx_pool: catch exceptions in LockedTXN dtor
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-04 10:18:38 +01:00
moneromooo-monero e72e625eb1
tx_pool: wrap tx meta updates in a LockedTXN 2017-08-29 16:35:19 +01:00
Riccardo Spagni 72b5f37f58
Merge pull request #2349
1914c999 txpool: update db tx metadata when it changes (moneromooo)
4dbf29bd txpool: add tx size median to the pool stats (moneromooo)
2017-08-27 18:15:13 +02:00
moneromooo-monero 55bec1f03d
rpc: add a new RPC to get current txpool backlog (sizes and fees) 2017-08-26 16:23:31 +01:00
moneromooo 1914c999c7
txpool: update db tx metadata when it changes 2017-08-25 22:21:51 +01:00
moneromooo 4dbf29bd32
txpool: add tx size median to the pool stats 2017-08-25 22:21:38 +01:00
Howard Chu ea15e72d73
tx_pool: fix crash in stats
if tx receive_time == now. supersedes #2322
2017-08-23 14:22:25 +01:00
moneromooo-monero 02d66db4b4
tx_pool: initialize padding in txpool meta structure 2017-07-02 18:45:29 +01:00
Riccardo Spagni 78f965a9e2
Merge pull request #2082
235df7f4 blockchain_db: add a txpool tx getter which returns existence (moneromooo-monero)
2017-06-18 17:36:12 +02:00
moneromooo-monero 235df7f484
blockchain_db: add a txpool tx getter which returns existence
Avoids exception spam for the "nope, not found" case
2017-06-11 15:36:48 +01:00
Howard Chu 3fc22e7b78
Add histogram to poolstats 2017-06-04 22:48:14 +01:00
Riccardo Spagni 4a60e9e66e
Merge pull request #2062
31417d57 tx_pool: add missing blockchain lock in add_tx (moneromooo-monero)
2017-06-01 19:33:17 +02:00
Howard Chu 5414970dcd
Speedup print_pool_stats
Since we're just counting txs, there's no reason to deserialize all the blobs.
2017-06-01 17:34:03 +01:00
moneromooo-monero 31417d57da
tx_pool: add missing blockchain lock in add_tx 2017-05-31 22:55:13 +01:00
Riccardo Spagni 545e2b003c
Merge pull request #1982
b52abd13 Move txpool to the database (moneromooo-monero)
2017-05-30 21:12:44 +02:00
moneromooo-monero b52abd1370
Move txpool to the database
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-25 22:23:37 +01:00
assylias bff90264b8
Add expected total reward to RPC "getblocktemplate".
Only works from V5 fork onward - returns 0 before that block.
2017-04-19 18:28:16 +01:00
moneromooo-monero 893f5a301e
tx_pool: add blob size and fee/byte when logging a new tx 2017-04-04 09:04:11 +01:00
Riccardo Spagni a73a886cb1
Merge pull request #1911
91d41090 tx_pool: ensure txes loaded from poolstate.bin have their txid cached (moneromooo-monero)
aaeb164c tx_pool: remove transactions if they're in the blockchain (moneromooo-monero)
558cfc31 core, wallet: faster tx pool scanning (moneromooo-monero)
f065234b core: cache tx and block hashes in the respective classes (moneromooo-monero)
2017-03-23 11:46:57 +02:00
moneromooo-monero 91d4109023
tx_pool: ensure txes loaded from poolstate.bin have their txid cached
The txid is not saved, and we want to make sure the transactions
have their txid cached while in the pool, since get_transactions
copies the transaction object, so any txid calculation on those
copies would not benefit any later caller, since the original tx
would be left without a cached txid.
2017-03-23 09:25:33 +00:00
moneromooo-monero aaeb164cf6
tx_pool: remove transactions if they're in the blockchain
When starting up, if the pool state was not saved, the pool
might contain transactions which made it into the blockchain,
so these need removing
2017-03-23 09:25:29 +00:00