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

Fix for non-spendable merged mining reward #7

Closed
wants to merge 1 commit into from

Conversation

amphibia
Copy link

No description provided.

@monero-project
Copy link
Collaborator

I want to look into this a little more before merging, as it appears to ignore false returns of parse_tx_extra which could be a bad thing.

In the future please test outputs from your code to ensure it passes checks by adding a new testing function in tests/unit_tests/test_format_utils.cpp.

@amphibia
Copy link
Author

Currently, there is a problem that you can't spend coins which you've mined with merged mining. This fix is resolving this issue - I would recommend you to merge it as soon as possible since the more we wait - the more people are facing this issue.
This fix is the same as the code in wallet2::process_new_transaction() method. Parse_tx_extra() is called and in case of an error work continues. Wallet2::process_new_transaction() method is ending with an error only in case of false response from find_tx_extra_field_by_type<tx_extra_pub_key>() function.
Now get_tx_pub_key_from_extra() function is working this way: if parse_tx_extra() returns false - it ignores it, null_pkey returns only if find_tx_extra_field_by_type<tx_extra_pub_key>() returns false.

@monero-project
Copy link
Collaborator

This issue has been fixed by these commits:
5c820f9
73158c7

This adds a custom handler/serializer for merge mining datafields contained in tx_extra, and still causes the wallet to throw errors when bizarre data is added in tx_extra.

Please let me know if these changes are unsatisfactory.

@amphibia
Copy link
Author

Yes, indeed your changes are correct you’re receiving MM transactions just fine, for that I apologise. But my changes are intended for transaction’s extra processing. This way your daemon will be able to receive any transactions - including the ones with pretty much anything in extra field and users will not face “unspendable money” issue.

@monero-project
Copy link
Collaborator

Right, I agree it may be a bug in ByteCoin's code to throw an error there. I think perhaps parse_tx_extra itself should be modified so that it reports an error ("unidentified tx_extra fields contained in transaction [hash]") but does not throw an error through CHECK_AND_NO_ASSERT_MES that causes the transfer function to crash. Let me confer with the other devs and see what they think.

edit:
Oh, sorry, it looks like that may be an inaccurate description of the crash; I think it goes through bool lookup_acc_outs(...) {...} when it returns false unless I'm mistaken. So corrected behaviour should be something like (pseudocode):

deserialize tx_extra
determine tx_extra_type
if (tx_extra_type == UNKNOWN) { log error }
else if (tx_extra_type == pubkey_containing) { extract_pubkeys }

and the error is thrown at the level of

bool r = lookup_acc_outs(m_account.get_keys(), tx, tx_pub_key, outs, tx_money_got_in_outs);
THROW_WALLET_EXCEPTION_IF(!r, error::acc_outs_lookup_error, tx, tx_pub_key, m_account.get_keys());

in wallet2.cpp

mikezackles pushed a commit to mikezackles/bitmonero that referenced this pull request Jun 26, 2014
[URGENT] Fix for simpleminer's MinerGate compatibility
mathstuf pushed a commit to mathstuf/bitmonero that referenced this pull request Nov 17, 2014
revler1082 pushed a commit to revler1082/monero that referenced this pull request Nov 4, 2016
# The first commit's message is:

Added a new command to the P2P protocol definitions to allow querying for support flags.

# This is the commit message monero-project#2:

Implemented handling of new support flags command in net_node. Changed for_each callback template to include support flags. Updated print_connections command to show peer support flags.

# This is the commit message monero-project#3:

Added p2p constant for signaling fluffy block support.

# This is the commit message monero-project#4:

Added get_pool_transaction function to cryptnote_core.

# This is the commit message monero-project#5:

Added new commands to cryptonote protocol for relaying fluffy blocks.

# This is the commit message monero-project#6:

Implemented handling of fluffy block command in cryptonote protocol.

# This is the commit message monero-project#7:

Enabled fluffy block support in node initial configuration.

# This is the commit message monero-project#8:

Patched a bug where only outgoing connections were populating support flag.

# This is the commit message monero-project#9:

Added return code checks in fluffy-block handling function. Cleaned up some whitespace and debug code.

# This is the commit message monero-project#10:

Changed from requesting missing transactions by hash, to requesting by index instead for extra space savings.

# This is the commit message monero-project#11:

Whitespace cleanup.
@will22 will22 mentioned this pull request Nov 18, 2016
stoffu pushed a commit to stoffu/monero that referenced this pull request May 21, 2018
@Pei116 Pei116 mentioned this pull request Jul 30, 2018
scilicet64 referenced this pull request in Beldex-Coin/beldex Mar 20, 2019
Update testnet seed nodes
cryptochangements34 pushed a commit to cryptochangements34/monero that referenced this pull request Jul 3, 2019
lxop pushed a commit to lxop/monero that referenced this pull request Jan 27, 2021
…build-for-boost-1.67

Feature/fix build for boost 1.67
ndorf pushed a commit to mymonero/monero that referenced this pull request Jun 7, 2021
Changed include to quotes instead of angled brackets
MarketKernel added a commit to awaik/monero that referenced this pull request Aug 15, 2023
j-berman referenced this pull request in j-berman/monero Oct 16, 2023
seraphis_impl: jamtis base32 checksums
@tczee36 tczee36 mentioned this pull request Jan 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants