-
Notifications
You must be signed in to change notification settings - Fork 92
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 Payment Request reorganizations #456
Fix for Payment Request reorganizations #456
Conversation
@aguycalled I see that your travis-ci run for this PR on x86_64 linux is failing with similar error to my test, any ideas on what the cause is? |
56762f1
to
ca7e88b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not really familiar with the logic in the wallet CFUND code, so I don't think I'm qualified to review that.
But the changes i the unit test seem good.
I just need you to make 1 edit
@@ -3246,7 +3246,7 @@ bool ConnectBlock(const CBlock& block, CValidationState& state, CBlockIndex* pin | |||
} else if (out.scriptPubKey.IsPayToPublicKey() || out.scriptPubKey.IsColdStaking()) { | |||
uint160 hashBytes; | |||
int type = 0; | |||
CTxDestination destination; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we should add .editorconfig
to the project?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So we can standardize the white space and some other basic configs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
The issue this PR fixes can be reproduced as follows:
Tested succesfully with 2 nodes locally in devnet. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Test looks good.
compiling and starting to review this now. |
Looks like the latest build has an issue with |
Roger that.
…On Thu, May 2, 2019, 14:26 proletesseract ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In qa/rpc-tests/cfund-paymentrequest-state-reorg.py
<#456 (comment)>:
> + while self.nodes[1].getblockcount() == blockcount_1:
+ time.sleep(1)
+
+ print("nodes staked!")
+
+ self.nodes[0].staking(False)
+ self.nodes[1].staking(False)
+
+ node_0_best_hash = self.nodes[0].getblockhash(self.nodes[0].getblockcount())
+ node_1_best_hash = self.nodes[1].getblockhash(self.nodes[1].getblockcount())
+ node_0_nbits = int(self.nodes[0].getblock(node_0_best_hash)["bits"], 16)
+ node_1_nbits = int(self.nodes[1].getblock(node_1_best_hash)["bits"], 16)
+
+ # Node 0 and Node 1 have forked. Difficulty in Node 0 must be higher (hence lower nbits)
+ assert(node_0_best_hash != node_1_best_hash)
+ assert(node_0_nbits < node_1_nbits)
Yeah, the hashes are different but the nbits are the same. im reverting
the target time to 30 seconds and seeing if it makes a difference.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#456 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAIDAKJXIJSP6G5BDKQTAY3PTKCRTANCNFSM4HJPJQKA>
.
|
You mean ACK :P |
I see |
It's just short for "Acknowledged" AFAIK. see: bitcoin/bitcoin#6100 |
I've changed the check so it looks at chainwork instead of nbits. |
Looks like final commit fixed the issue with the test. @craigmacgregor ready to merge? :) |
Travis failing again. Investigating. |
it's failing again uniquely because of a random fee in the coldstaking_* tests |
my local build and tests pass on Ubuntu 18.04, waiting for Travis. |
Merging Master for PR navcoin#456
Merging Master for PR navcoin#456
This PR prevents payment requests with invalid hashes (not set yet or out of the main chain) to count for the already requested balance of a proposal.