Come-from-Beyond (OP)
Legendary
Offline
Activity: 2142
Merit: 1010
Newbie
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
January 06, 2014, 03:54:50 PM |
|
A SIGTERM shouldn't corrupt anything?
No idea, I prefer BareMetal OS. I don't like interface with a lot of icons.
|
|
|
|
jkoil
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
January 06, 2014, 05:17:04 PM Last edit: January 06, 2014, 05:51:44 PM by jkoil |
|
What information transactions.nxt contains? Blockchain Explorer shows just timestamp, numbers, IDs for a transaction, but transactions.nxt contain also names and http addresses. Eg. "warhorse", " http://google.com", "paperwallet", "darkwallet", "cloudwallet", ...
|
|
|
|
gsan1
Newbie
Offline
Activity: 50
Merit: 0
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
January 06, 2014, 06:00:13 PM |
|
Line 6707: counter++; if (counter >= 255) {
break;
}
Why is there a counter, so that only 255 transactions get returned? I know that this is the maximum amount of transactions in a block, but there is no reason why I could get more unconfirmed transactions by another peer, isn't it?
|
|
|
|
nexern
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
January 06, 2014, 06:03:58 PM |
|
What information transactions.nxt contains? Blockchain Explorer shows just timestamp, numbers, IDs for a transaction, but transactions.nxt contain also names and http addresses. Eg. "warhorse", " http://google.com", "paperwallet", "darkwallet", "cloudwallet", ... these are attached aliases
|
|
|
|
ferment
Full Member
![*](https://bitcointalk.org/Themes/custom1/images/star.gif) ![*](https://bitcointalk.org/Themes/custom1/images/star.gif)
Offline
Activity: 168
Merit: 100
IDEX - LIVE Real-time DEX
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
January 06, 2014, 06:30:54 PM |
|
A SIGTERM shouldn't corrupt anything?
No idea, I prefer BareMetal OS. I don't like interface with a lot of icons. SIGTERM is the signal sent by Unix 'kill' command as the standard way to cleanly shutdown a process.
|
|
|
|
Come-from-Beyond (OP)
Legendary
Offline
Activity: 2142
Merit: 1010
Newbie
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
January 06, 2014, 06:52:03 PM |
|
Line 6707: counter++; if (counter >= 255) {
break;
}
Why is there a counter, so that only 255 transactions get returned? I know that this is the maximum amount of transactions in a block, but there is no reason why I could get more unconfirmed transactions by another peer, isn't it? This is to limit volume of data sent between nodes.
|
|
|
|
ricot
Newbie
Offline
Activity: 56
Merit: 0
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
January 06, 2014, 06:56:08 PM |
|
A SIGTERM shouldn't corrupt anything?
No idea, I prefer BareMetal OS. I don't like interface with a lot of icons. SIGTERM is the signal sent by Unix 'kill' command as the standard way to cleanly shutdown a process. Taking a short look at the code, totally possible that it messes up everything. Usually, you'd first write to a temporary file, and when it's finished you'd move it in place and therefore overwrite the old one, since that's only one atomic operation... In case the process ends while writing, you just have a half-written temporary lying around. This client doesn't do the moving thing, so as soon as you SIGKILL or even SIGTERM it while it's writing, it's in a bad state.
|
|
|
|
LiQio
Legendary
Offline
Activity: 1181
Merit: 1002
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
January 06, 2014, 07:24:40 PM |
|
hey ricot, thanks a lot for your work - just sent you a beer! cheers!
|
|
|
|
ferment
Full Member
![*](https://bitcointalk.org/Themes/custom1/images/star.gif) ![*](https://bitcointalk.org/Themes/custom1/images/star.gif)
Offline
Activity: 168
Merit: 100
IDEX - LIVE Real-time DEX
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
January 06, 2014, 08:14:13 PM Last edit: January 06, 2014, 08:38:10 PM by ferment |
|
A SIGTERM shouldn't corrupt anything?
No idea, I prefer BareMetal OS. I don't like interface with a lot of icons. SIGTERM is the signal sent by Unix 'kill' command as the standard way to cleanly shutdown a process. Taking a short look at the code, totally possible that it messes up everything. Usually, you'd first write to a temporary file, and when it's finished you'd move it in place and therefore overwrite the old one, since that's only one atomic operation... In case the process ends while writing, you just have a half-written temporary lying around. This client doesn't do the moving thing, so as soon as you SIGKILL or even SIGTERM it while it's writing, it's in a bad state. Ok... brushed up on my Java and dove in: @Override public void destroy() { scheduledThreadPool.shutdown(); cachedThreadPool.shutdown(); try { Block.saveBlocks("blocks.nxt"); } catch (Exception e) { } try { Transaction.saveTransactions("transactions.nxt"); } catch (Exception e) { } try { blockchainChannel.close(); } catch (Exception e) { } logMessage("Nxt stopped."); } }
Since scheduledThreadPool.shutdown() (and cachedThreadPool) doesn't wait for the threads to actually finish before returning, it might create a condition where saveBlocks blocks the threads that are trying to shutdown due to the synchronized on blocks. So it might be possible for destroy() to exit before the thread pools have completely shutdown, which could cause corruption of blocks.nxt if something bad happens in the threads. The fix is to call awaitTermination on the threadpools before call Block.saveBlocks.
|
|
|
|
Jean-Luc
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
January 06, 2014, 08:45:12 PM |
|
The fix is to call awaitTermination on the threadpools before call Block.saveBlocks. This has been fixed since 0.4.9e. Waiting up to 10 s, then shutdownNow.
|
|
|
|
ferment
Full Member
![*](https://bitcointalk.org/Themes/custom1/images/star.gif) ![*](https://bitcointalk.org/Themes/custom1/images/star.gif)
Offline
Activity: 168
Merit: 100
IDEX - LIVE Real-time DEX
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
January 06, 2014, 09:30:03 PM |
|
The fix is to call awaitTermination on the threadpools before call Block.saveBlocks. This has been fixed since 0.4.9e. Waiting up to 10 s, then shutdownNow. Guess that's not what is killing 80% of my nodes. heh.
|
|
|
|
klee
Legendary
Offline
Activity: 1498
Merit: 1000
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
January 06, 2014, 09:31:04 PM |
|
smaragda, ricot, vamdor, ImmortAlex, rlh: Please PM your NXT tip account. Thanks for pouring through the code.
FrictionlessCoin send yours too cuz you need a NXT hug.
Post your addresses guys (gals?) I wanna reward your efforts... ricot : 100K ImmortAlex :50K vamdor: 50K rlh: 50K smaragda: 50K
|
|
|
|
Come-from-Beyond (OP)
Legendary
Offline
Activity: 2142
Merit: 1010
Newbie
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
January 06, 2014, 09:38:44 PM |
|
smaragda, ricot, vamdor, ImmortAlex, rlh: Please PM your NXT tip account. Thanks for pouring through the code.
FrictionlessCoin send yours too cuz you need a NXT hug.
Post your addresses guys (gals?) I wanna reward your efforts... ricot : 100K ImmortAlex :50K vamdor: 50K rlh: 50K smaragda: 50K What about FrictionlessCoin? ![Grin](https://bitcointalk.org/Smileys/default/grin.gif)
|
|
|
|
klee
Legendary
Offline
Activity: 1498
Merit: 1000
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
January 06, 2014, 09:47:21 PM |
|
smaragda, ricot, vamdor, ImmortAlex, rlh: Please PM your NXT tip account. Thanks for pouring through the code.
FrictionlessCoin send yours too cuz you need a NXT hug.
Post your addresses guys (gals?) I wanna reward your efforts... ricot : 100K ImmortAlex :50K vamdor: 50K rlh: 50K smaragda: 50K What about FrictionlessCoin? ![Grin](https://bitcointalk.org/Smileys/default/grin.gif) I will pay him in his scamcoin ![Tongue](https://bitcointalk.org/Smileys/default/tongue.gif)
|
|
|
|
utopianfuture
Sr. Member
![*](https://bitcointalk.org/Themes/custom1/images/star.gif) ![*](https://bitcointalk.org/Themes/custom1/images/star.gif) ![*](https://bitcointalk.org/Themes/custom1/images/star.gif)
Offline
Activity: 602
Merit: 268
Internet of Value
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
January 06, 2014, 09:47:43 PM |
|
smaragda, ricot, vamdor, ImmortAlex, rlh: Please PM your NXT tip account. Thanks for pouring through the code.
FrictionlessCoin send yours too cuz you need a NXT hug.
Post your addresses guys (gals?) I wanna reward your efforts... ricot : 100K ImmortAlex :50K vamdor: 50K rlh: 50K smaragda: 50K That's great klee. I hope you would be NXT billionaire in two years. Don't forget to helicopter me to your private island at that time
|
|
|
|
klee
Legendary
Offline
Activity: 1498
Merit: 1000
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
January 06, 2014, 09:48:26 PM |
|
Post your addresses guys (gals?) I wanna reward your efforts...
ricot : 100K ImmortAlex :50K vamdor: 50K rlh: 50K smaragda: 50K
Is this for real?!? ![Shocked](https://bitcointalk.org/Smileys/default/shocked.gif) TRULY APPRECIATED! ![Grin](https://bitcointalk.org/Smileys/default/grin.gif) ...address is in my signature... Check!
|
|
|
|
klee
Legendary
Offline
Activity: 1498
Merit: 1000
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
January 06, 2014, 09:49:09 PM |
|
smaragda, ricot, vamdor, ImmortAlex, rlh: Please PM your NXT tip account. Thanks for pouring through the code.
FrictionlessCoin send yours too cuz you need a NXT hug.
Post your addresses guys (gals?) I wanna reward your efforts... ricot : 100K ImmortAlex :50K vamdor: 50K rlh: 50K smaragda: 50K That's great klee. I hope you would be NXT billionaire in two years. Don't forget to helicopter me to your private island at that time You will be in my VIP list ![Tongue](https://bitcointalk.org/Smileys/default/tongue.gif)
|
|
|
|
BloodyRookie
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
January 06, 2014, 09:52:40 PM |
|
smaragda, ricot, vamdor, ImmortAlex, rlh: Please PM your NXT tip account. Thanks for pouring through the code.
FrictionlessCoin send yours too cuz you need a NXT hug.
Post your addresses guys (gals?) I wanna reward your efforts... ricot : 100K ImmortAlex :50K vamdor: 50K rlh: 50K smaragda: 50K Hey, I am a nice guy too ![Cheesy](https://bitcointalk.org/Smileys/default/cheesy.gif)
|
Nothing Else Matters NEM: NALICE-LGU3IV-Y4DPJK-HYLSSV-YFFWYS-5QPLYE-ZDJJ NXT: 11095639652683007953
|
|
|
Come-from-Beyond (OP)
Legendary
Offline
Activity: 2142
Merit: 1010
Newbie
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
January 06, 2014, 09:58:42 PM |
|
|
|
|
|
instacalm
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
January 06, 2014, 10:05:41 PM |
|
smaragda, ricot, vamdor, ImmortAlex, rlh: Please PM your NXT tip account. Thanks for pouring through the code.
FrictionlessCoin send yours too cuz you need a NXT hug.
Post your addresses guys (gals?) I wanna reward your efforts... ricot : 100K ImmortAlex :50K vamdor: 50K rlh: 50K smaragda: 50K Greetings to sunny Greece. ![Grin](https://bitcointalk.org/Smileys/default/grin.gif) ![](https://ip.bitcointalk.org/?u=http%3A%2F%2Fwww.freiehonnefer.de%2Fwp-content%2Fthemes%2Fmagazine%2Fimages%2Fklee.jpg&t=665&c=5a6CnL_Rux8doQ)
|
|
|
|
|