Skip to content

Conversation

kallewoof
Copy link
Contributor

@kallewoof kallewoof commented Apr 23, 2017

The once-a-minute LogPrintf in ScanForWalletTransactions will do a null-ref if it happens to hit the 60s mark right at the last block (where pindex becomes null). This was moved up to the top of the block instead, where the while (pindex && !fAbortRescan) has checked pindex for us.

@jonasschnelli
Copy link
Contributor

Nice catch!
utACK 6b816dc

@NicolasDorier
Copy link
Contributor

utACK 6b816dc. I am surprised there were no more bug report about that.

@mchrostowski
Copy link
Contributor

@kallewoof I would go with temptation and move the GetTime() >= nNow check to line 1554 as it is vaguely related to ShowProgress, this could help with readability too.

@kallewoof
Copy link
Contributor Author

@mchrostowski Did you mean 1545 by any chance?

@paveljanik
Copy link
Contributor

Concept ACK
@kallewoof Agree with the move to the top of the block.

@kallewoof kallewoof force-pushed the fix-check-pindex-scanforwallettx branch from 6b816dc to c36ea69 Compare April 25, 2017 07:19
@kallewoof
Copy link
Contributor Author

This PR is now a MOVEONLY. 4 lines moved up to L1547-1550 from L1560-1563.

@kallewoof kallewoof changed the title [wallet] Check non-null pindex before potentially referencing [wallet] [moveonly] Check non-null pindex before potentially referencing Apr 25, 2017
@laanwj
Copy link
Member

laanwj commented Apr 25, 2017

utACK c36ea69

@laanwj laanwj merged commit c36ea69 into bitcoin:master Apr 25, 2017
laanwj added a commit that referenced this pull request Apr 25, 2017
…ially referencing

c36ea69 [wallet] Make sure pindex is non-null before possibly referencing in LogPrintf call. (Karl-Johan Alm)

Tree-SHA512: a14c9f3e1228bca91977bea821c56a377d80889b41d250050c9be67aa93e460319a7cf1d4b63ee40f23b5a34159590f0e3fe15dc88698dc694c0c8098bd2db4d
@kallewoof kallewoof deleted the fix-check-pindex-scanforwallettx branch April 25, 2017 14:22
luke-jr pushed a commit to luke-jr/bitcoin that referenced this pull request Jun 5, 2017
nomnombtc pushed a commit to nomnombtc/bitcoin that referenced this pull request Jul 17, 2017
codablock pushed a commit to codablock/dash that referenced this pull request Jan 26, 2018
… potentially referencing

c36ea69 [wallet] Make sure pindex is non-null before possibly referencing in LogPrintf call. (Karl-Johan Alm)

Tree-SHA512: a14c9f3e1228bca91977bea821c56a377d80889b41d250050c9be67aa93e460319a7cf1d4b63ee40f23b5a34159590f0e3fe15dc88698dc694c0c8098bd2db4d
andvgal pushed a commit to energicryptocurrency/gen2-energi that referenced this pull request Jan 6, 2019
… potentially referencing

c36ea69 [wallet] Make sure pindex is non-null before possibly referencing in LogPrintf call. (Karl-Johan Alm)

Tree-SHA512: a14c9f3e1228bca91977bea821c56a377d80889b41d250050c9be67aa93e460319a7cf1d4b63ee40f23b5a34159590f0e3fe15dc88698dc694c0c8098bd2db4d
CryptoCentric pushed a commit to absolute-community/absolute that referenced this pull request Feb 27, 2019
… potentially referencing

c36ea69 [wallet] Make sure pindex is non-null before possibly referencing in LogPrintf call. (Karl-Johan Alm)

Tree-SHA512: a14c9f3e1228bca91977bea821c56a377d80889b41d250050c9be67aa93e460319a7cf1d4b63ee40f23b5a34159590f0e3fe15dc88698dc694c0c8098bd2db4d
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Dec 16, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants