URI-handling code update: added safety checks and notifications#1002
URI-handling code update: added safety checks and notifications#1002laanwj merged 1 commit intobitcoin:masterfrom Diapolo:URL-handling_2
Conversation
Diapolo
commented
Mar 28, 2012
- validate bitcoin address in the URI before switching to sendCoinsPage and pasting into the form, when a bitcoin: link is clicked
- validate bitcoin address in the URI before switching to sendCoinsPage and pasting into the form, when a bitcoin: link is dropped on the Bitcoin-Qt window (Drag&Drop feature)
- show a tray-notification if an URI could not be parsed to alert the user
|
Good idea. I think there should also be a notification if an invalid URI is sent, to
|
|
I'm going to add what you suggested :), sounds good. |
|
I added message boxes. A hint would be nice, if I should call "it" URL or URI ;)? Edit: I will take URI in the message boxes and where a user can see it and retain the current naming and not change code, where not needed! Will update the strings tomorrow... |
|
Nitpick: use notificator, not a message box Re: URI or URL, I'm fine with either. Though URI is the most correct, more users know what URL means. |
|
Cool idea with the notificator, will see how that looks :). |
|
Changed to notificator, which is much better/smoother in terms of usability and usage flow. |
|
Can you please rebase this into one commit? |
|
Done :). |
src/qt/bitcoingui.cpp
Outdated
There was a problem hiding this comment.
I'd use the exact same message here as on line 752 as there is no real need to distinguish between "URI handling and URI handling - drag&drop", and no one drags more URLs at a time. Saves the translators some work.
There was a problem hiding this comment.
Agreed :). Thanks for your valuable suggestions.
Edit: Is it possible to paste more than 1 URI at all? I'm asking with the foreach in my mind.
src/qt/bitcoingui.cpp
Outdated
|
Rebase to current master and all remaining URL / url were re-named to URI / uri ;). |
src/qt/guiutil.cpp
Outdated
There was a problem hiding this comment.
These two need to be changed to URI to compile.
|
Rebased once more and fixed the 2 glitches luke observed :). |
|
What does @TheBlueMatt think about this? |
src/qt/bitcoingui.cpp
Outdated
There was a problem hiding this comment.
I would think it would be better to handle any valid URIs and ignore invalid ones if there are valid ones present, but I dont really think many OSs will give a list of URIs unless you are dragging a folder full of files, and in that case, none of them will be bitcoin:, so it probably doesnt matter.
|
Those are minor gripes anyway, ACK |
|
@TheBlueMatt I'll look into your suggestions, even small glitches can be changed / fixed :). |
|
Rebased once more, merged the 3 commits into a single one and re-worked a few days ago to include one of @TheBlueMatt suggestions. |
|
Rebased and reworded the commit message! |
|
Rebased and fixed merge-conflict. Can this get in please, if there are no further wishes? |
|
I think this one's waiting for URI support to be resurrected. Otherwise, it's kind of hard (and insensible) to test. |
|
At least for Linux URI-support is in the client ;). And it's working fine with my build ^^, just wanted to bring this back into devs-mind. |
|
I agree with @Diapolo here, we have a huge list of pulls piling up (dont we always...) and I see little reason to not pull this because URIs are supported, just not on Windows or Mac. |
|
If this would get in, I didn't need to rebase and keep this current, so ... :). |
|
Updated to use toggleHidden() function for showing the window after a bitcoin-URI was clicked. |
|
Rebased to fix a merge-conflict. |
|
Rebased and changed back the use of toggleHidden() into showNormalIfMinimized() as another pull takes care of this. Can we please merge this with #1437! |
|
Updated to fix a merge conflict. |
URI-handling code update: added safety checks and notifications
URI-handling code update: added safety checks and notifications
[Phase1] Introduce shared pointers for transactions: Make CBlock a vector of shared tx pointers
4ea0476 [Consensus] Fix difficulty adjustment on first block of timeproto V2 (random-zebra) c254df6 [P2P] Do not store more than 200 timedata samples. (random-zebra) 8ca3979 [Tests] (squashed) few regtest fixes (random-zebra) 3487e58 [PoS] Fix Stake maturity-check and mapHashedBlocks time (random-zebra) 55aeecd [Core] raise nTargetTimespan_V2 to 30 minutes (random-zebra) 79bdc83 [Core] Restore CheckBlock checks before previous block check (random-zebra) 3bb0c0a [PoS] Don't use chainActive.Tip() as prevIndex when creating new blocks (random-zebra) 55faec1 [Performance] Kernel, methods using object reference instead of copy the object. (furszy) 4afcba5 [PoS] Don't allow consecutive blocks within the same time slot (random-zebra) c97e998 [PoS] StakeV1: iterate the time backwards. (random-zebra) 59cd3af [PoS] reduce difficulty by a factor 16 on nBlockTimeProtocolV2 (random-zebra) 3447dfb [Core] Make bnProofOfStakeLimit_V2 16 times v1 limit (random-zebra) 0bcf0c1 [PoS] Keep v1 miner until hard-fork (random-zebra) ec45670 [Core] Guard the transition to v2 time protocol in MinPastBlockTime rule (random-zebra) fee5f5c [PoS] set nTargetTimespan_V2 to 15 minutes (60 time slots) (random-zebra) ca2b035 [PoS] Set target spacing to 60 seconds (random-zebra) 0578b0a [PoS] Adjust FutureBlockTimeDrift to 15 secs granularity (random-zebra) dd71075 [Core] Set time granularity to 15 (instead of 16) (random-zebra) 8c3546f [Consensus] Change difficulty computation for V2 time protocol (random-zebra) f892e45 [Core/PoS] Enforce timestamp mask in miner (random-zebra) cdaf818 [Core] Define new Past Time Limit and enforce masked time (random-zebra) bcb5836 [Core] Define new Future Time Drift (random-zebra) 159eda9 [Cleanup] Remove unused function CheckCoinStakeTimestamp (random-zebra) 9773c09 [Core] Add timestamp mask to chainparams (random-zebra) 1d8fb33 [COPY] Update missing headers (random-zebra) 6f09121 [Consensus] Add placeholder block height for Time Protocol V2 (random-zebra) Pull request description: Main changes: - **granularity**: 15 secs, instead of 1 - **future limit**: adjustedTime + 14 secs (current timeslot) instead of 3 mins - **past limit**: prevBlock time - **target timespan**: 15 mins (instead of 40) ACKs for top commit: furszy: Great, ACK 4ea0476 Mrs-X: ACK PIVX-Project@4ea0476 Tree-SHA512: a365297ba169f78ad1c30cc2f318dce09d6e98038a43d35c645814923829e793147e7fdbcbb3f701878a1f5f4892f468f19451fcacc25973db63c92c02e40aa1
f14af4f [Trivial] Fix timedata.cpp includes (random-zebra) b6992ac [Tests] Add p2p_time_offset functional test to test_runner (random-zebra) faf03a6 [Tests] Define p2p_time_offset functional test (random-zebra) d9e9284 [Consensus] reduce possible nTimeOffset to 15 seconds (random-zebra) Pull request description: Open for brainstorming. Follow up to bitcoin#1002 - reject connection with a node having offset higher than 30 secs (and don't add the sample to timedata) - repeatedly trigger the warning message when the total offset (absolute value) is above 15 seconds (and set the offset to +15/-15 instead of 0). ACKs for top commit: Fuzzbawls: utACK f14af4f Mrs-X: NIT that the last LogPrintf() does not have a time-unit anymore, but utACK PIVX-Project@f14af4f Warrows: ACK f14af4f Tree-SHA512: e2a8b7ee7718814ce49fcb536af48afcf1b2829644699abbe5279b064efe1ff066c3100e65229abf06a7787b9f6e813b971300404841a0e6fe41375780a5e318
Given the strict timestamp checks enforced with POS TimeProtocol v2 (introduced with bitcoin#1002: a block cannot have a timestamp earlier than previous blocks and cannot be more than 15 seconds in the future), we don't need the complex (and error-prone) logic of ComputeTimeSmart. We can, instead, simply rely on the blocktime, which already ensures a proper ordering for the transactions.
0c581fb [GUI] Update the record time when wtx.nTimeSmart changes (random-zebra) b1dc5d3 [Refactor] Encapsulate ComputeTimeSmart in CWalletTx (random-zebra) db99c41 [Cleanup] Remove unneeded GetComputedTxTime (random-zebra) 3f31b4f [Bug] Fix nTimeSmart computation (random-zebra) Pull request description: Given the strict timestamp checks enforced with POS TimeProtocol v2 (introduced with bitcoin#1002: a block cannot have a timestamp earlier than previous blocks and cannot be more than 15 seconds in the future), we don't need the complex (and error-prone) logic of the current implementation of `ComputeTimeSmart`. We can, instead, simply rely on the blocktime, which already ensures a proper ordering for the transactions. This also allows us to encapsulate the function in the `CWalletTx` class (renaming it to `UpdateTimeSmart`). We can also get rid of the additional `GetComputedTxTime` (with its additional LOCK, and main chain lookup), and just use `GetTxTime`. Finally, update the nSmartTime when a mempool transaction is added to a block. This should, hopefully, fix bitcoin#1346 (further testing needed). ACKs for top commit: furszy: ACK 0c581fb . Fuzzbawls: ACK 0c581fb Tree-SHA512: 6d2bed1fafa7a658bd42ff2f7fe003087de368e2f49088104bce2409e4370caee0e1a153dc519525d7647b7afa1322fa1be968eefbd299404e1c8a521e24023e