Bitcoin Forum
May 26, 2024, 08:01:27 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: « 1 2 3 4 5 [6] 7 8 9 10 »  All
  Print  
Author Topic: Nxt source code analysis (QA)  (Read 14062 times)
bitcool
Legendary
*
Offline Offline

Activity: 1441
Merit: 1000

Live and enjoy experiments


View Profile
January 05, 2014, 05:00:15 PM
 #101

You know why I hang out in the Nxt threads?

You write some garbage and you get honest answers from CfB. You are trolling around to learn a few tricks from CfB. This is just dishonorable.

I have the impression you don't want to be friendly and nice, FrictionlessCoin. Please, just go. Thank you.

If you are an expert in a field and you see an amateur do very shoddy work, the I think one would have the responsibility of pointing this out.

The work here is plain and simple shoddy.

Maybe the ideas may make sense (don't know,  I have not seen the spec),  but the work is shoddy.



I do think your job here is valuable, most points are valid.

Burying head in the sand and resisting any criticism are not good for any community's health.
bitcool
Legendary
*
Offline Offline

Activity: 1441
Merit: 1000

Live and enjoy experiments


View Profile
January 05, 2014, 05:04:36 PM
 #102

because it fit's into this thread just on thing which has attract my attention.

i have to admit that i am not a native java coder and i just have had a quick look at
the api part due to the client dev, therefore this could be nonsens but for me, the code
structure seems that the creator intentionally veiled his native codingstyle.

if so, i bet the flaws couldn't be found by hunting partial code strucs but more within the
logical flow in general. moreover, if this is correct, the energy needed to change a perhaps
long used coding style this way must be immense. at least there is no chance to get any
usefull code correlation this way.

as said, it could be totally wrong but i have seen many lines of code in different
languages, this structure doesn't seems coincidental for me.

perhaps a fluent java coder could have a quick overview again, with this in mind.

Very possible. The whole application running as a servlet in Jetty web server, it needs to interact w/ the servlet container.

It's not a good practice for applications taking control of threads directly,  and that destroy() method looks disturbing.



 
FrictionlessCoin
Legendary
*
Offline Offline

Activity: 868
Merit: 1000


Cryptotalk.org - Get paid for every post!


View Profile
January 05, 2014, 05:05:45 PM
 #103

You know why I hang out in the Nxt threads?

You write some garbage and you get honest answers from CfB. You are trolling around to learn a few tricks from CfB. This is just dishonorable.

I have the impression you don't want to be friendly and nice, FrictionlessCoin. Please, just go. Thank you.

If you are an expert in a field and you see an amateur do very shoddy work, the I think one would have the responsibility of pointing this out.

The work here is plain and simple shoddy.

Maybe the ideas may make sense (don't know,  I have not seen the spec),  but the work is shoddy.



I do think your job here is valuable, most points are valid.

Burying head in the sand and resisting any criticism are not good for any community's health.

If I were an investor,  I would like to know all the warts of what I'm investing in.  

My main coins I've invested in are BTC, LTC, NMC and IXC.  I have done my due diligence and I know exactly what their Pros and Cons are.   We aren't talking play money here anymore,  this is serious money.

So if people want to bury the truth, then that's there problem.


 
                                . ██████████.
                              .████████████████.
                           .██████████████████████.
                        -█████████████████████████████
                     .██████████████████████████████████.
                  -█████████████████████████████████████████
               -███████████████████████████████████████████████
           .-█████████████████████████████████████████████████████.
        .████████████████████████████████████████████████████████████
       .██████████████████████████████████████████████████████████████.
       .██████████████████████████████████████████████████████████████.
       ..████████████████████████████████████████████████████████████..
       .   .██████████████████████████████████████████████████████.
       .      .████████████████████████████████████████████████.

       .       .██████████████████████████████████████████████
       .    ██████████████████████████████████████████████████████
       .█████████████████████████████████████████████████████████████.
        .███████████████████████████████████████████████████████████
           .█████████████████████████████████████████████████████
              .████████████████████████████████████████████████
                   ████████████████████████████████████████
                      ██████████████████████████████████
                          ██████████████████████████
                             ████████████████████
                               ████████████████
                                   █████████
.CryptoTalk.org.|.MAKE POSTS AND EARN BTC!.🏆
ciappa
Hero Member
*****
Offline Offline

Activity: 840
Merit: 501



View Profile
January 05, 2014, 05:11:47 PM
 #104

Now are 2 nextcoin exchanges!

Dgex.com and nxtchg.com !

Why cryptsy, bter, vircurex etc. dont can trade nextcoins?

  ███
  ███
   
█████
█▀▄  █
█    ▀█
█▀▄  █
█    ▀█
█▀▄  █
█████
   
  ███
  ███
▄▄▄▄▄▄▄▄▄▄▄▄
██ ▀███▀  ▀█
██        ▀█
██▄       ██
█▀█▄     ███
██▄▄▄▄▄█████

██████▀▀▀███
█████  ▄▄███
████    ████
█████  █████
█████▄▄█████
Whitepaper
Announcement
Bounty
  ███
  ███
   
█████
█▀▄  █
█    ▀█
█▀▄  █
█    ▀█
█▀▄  █
█████
   
  ███
  ███
  ███
  ███
   
█████
█▀▄  █
█    ▀█
█▀▄  █
█    ▀█
█▀▄  █
█████
   
  ███
  ███

                      ▄▄
                  ▄▄████
              ▄▄████████
          ▄▄███████▀████
      ▄▄█████████▀ █████
  ▄▄███████████▀ ▄██████
█████████████▀  ████████
   ▀▀██████▀  ▄█████████
       ▀▀▀  ▄███████████
           ▄████████████
           █████████████
           ████▀  ▀▀████
           ██▀       ▀██
empowering
Legendary
*
Offline Offline

Activity: 1078
Merit: 1441



View Profile
January 05, 2014, 05:15:18 PM
Last edit: January 05, 2014, 05:39:14 PM by empowering
 #105

You know why I hang out in the Nxt threads?

You write some garbage and you get honest answers from CfB. You are trolling around to learn a few tricks from CfB. This is just dishonorable.

I have the impression you don't want to be friendly and nice, FrictionlessCoin. Please, just go. Thank you.

If you are an expert in a field and you see an amateur do very shoddy work, the I think one would have the responsibility of pointing this out.

The work here is plain and simple shoddy.

Maybe the ideas may make sense (don't know,  I have not seen the spec),  but the work is shoddy.



Show us what you have got then... apart from a terrible bedside manner ; )

So far from reading your posts it seems that far from being an expert, you seem to be quick to jump to conclusions , which show that you do not even read English properly, let alone code, and you are behaving in a way that is a little bit childish...  I note there are obviously some real experts that have been providing valuable and thoughtful/well though out intelligent feedback, what you are doing is some sort of constant bickering attack.  There is nothing wrong with being nice, thoughtful, and treating people and their work with some respect, and frankly even if your motives are good, which I question, then if you are trying to help people, then be a nice guy about it!  you may have more joy in actually helping people, because to help people you need to communicate wth people to get them to listen, not attack,  and at the end of the day if you are not helping, then you are just in the way, and if you are helping then how about a dose of humility and common decency along with that good deed?  You know, try not to be a jerk about it,  otherwise it is not avery attractive way to carry on, and will get you nothing in life. Just think about it.

Back on topic.  

"A foolish consistency is the hobgoblin of little minds"
nexern
Hero Member
*****
Offline Offline

Activity: 597
Merit: 500



View Profile
January 05, 2014, 05:25:00 PM
 #106

Now are 2 nextcoin exchanges!

Dgex.com and nxtchg.com !

Why cryptsy, bter, vircurex etc. dont can trade nextcoins?

questo thread è per l'analisi del codice ciappa. meglio chiedere questo direttamente
al thread principale, guardate qui -> https://bitcointalk.org/index.php?topic=345619.14720
jl777
Legendary
*
Offline Offline

Activity: 1176
Merit: 1132


View Profile WWW
January 05, 2014, 05:39:41 PM
 #107

ok, so what you're saying is that the entire next code is not good? Is next doomed to fail?

code -> good -> nxt -> good

code -> bad -> bugs -> fail

Frictionless clearly you want to make your own NXT and get chunk of genesis block. It seems someone was foolish enough to send you 100BTC?? I guess that wasn't enough for you, so you want to convince people how good you are at writing code.

Show me your skills. Post a single bug, however trivial that is actually a bug and not style. I have a lot of C experience, unfortunately not java, but enough similarities to be able to find bugs left and right if it was truly amateurish. After spending hours trying to find even off by one errors, I mostly found out that it was my off by one errors and the codes simplicity (in control flow) masks the complexity it was implementing.

Anybody can write lots of code to solve a complicated problem
Few can write a little code to solve a complicated problem

Fewer can write 4000 lines of code to create bitcoin level functionality, let alone what NXT has implemented with a few thousand more lines of "secret sauce" code. It is good that it was not released so you have to wait until april to release your super fantastic perfectly software engineered NGC coin that will just be a NXT copycat, even if you pay to refactor the current source code in the meatime. Good luck finding more fools to buy your coin.

James

P.S. I know there are ~6800 lines, I subtracted 3,000 lines of code due to inclusion of curve code, bignum code, hardcoding of genesis block and other data arrays and of course the plentiful blank lines. NXT core is only 4000 lines of java code that will run on cellphones. That does not fit my definition of amateur.

http://www.digitalcatallaxy.com/report2015.html
100+ page annual report for SuperNET
jl777
Legendary
*
Offline Offline

Activity: 1176
Merit: 1132


View Profile WWW
January 05, 2014, 05:42:33 PM
 #108

Now are 2 nextcoin exchanges!

Dgex.com and nxtchg.com !

Why cryptsy, bter, vircurex etc. dont can trade nextcoins?

You can also trade NXT on ripple using peercover, link in my sig

James

http://www.digitalcatallaxy.com/report2015.html
100+ page annual report for SuperNET
ciappa
Hero Member
*****
Offline Offline

Activity: 840
Merit: 501



View Profile
January 05, 2014, 06:02:20 PM
 #109

Thanks for your reply, I have now seen!
But I'm interested because nextcoin is already a significant crypto currency is not traded in cryptsy & Co?

  ███
  ███
   
█████
█▀▄  █
█    ▀█
█▀▄  █
█    ▀█
█▀▄  █
█████
   
  ███
  ███
▄▄▄▄▄▄▄▄▄▄▄▄
██ ▀███▀  ▀█
██        ▀█
██▄       ██
█▀█▄     ███
██▄▄▄▄▄█████

██████▀▀▀███
█████  ▄▄███
████    ████
█████  █████
█████▄▄█████
Whitepaper
Announcement
Bounty
  ███
  ███
   
█████
█▀▄  █
█    ▀█
█▀▄  █
█    ▀█
█▀▄  █
█████
   
  ███
  ███
  ███
  ███
   
█████
█▀▄  █
█    ▀█
█▀▄  █
█    ▀█
█▀▄  █
█████
   
  ███
  ███

                      ▄▄
                  ▄▄████
              ▄▄████████
          ▄▄███████▀████
      ▄▄█████████▀ █████
  ▄▄███████████▀ ▄██████
█████████████▀  ████████
   ▀▀██████▀  ▄█████████
       ▀▀▀  ▄███████████
           ▄████████████
           █████████████
           ████▀  ▀▀████
           ██▀       ▀██
FrictionlessCoin
Legendary
*
Offline Offline

Activity: 868
Merit: 1000


Cryptotalk.org - Get paid for every post!


View Profile
January 05, 2014, 06:30:06 PM
 #110

You know why I hang out in the Nxt threads?

You write some garbage and you get honest answers from CfB. You are trolling around to learn a few tricks from CfB. This is just dishonorable.

I have the impression you don't want to be friendly and nice, FrictionlessCoin. Please, just go. Thank you.

If you are an expert in a field and you see an amateur do very shoddy work, the I think one would have the responsibility of pointing this out.

The work here is plain and simple shoddy.

Maybe the ideas may make sense (don't know,  I have not seen the spec),  but the work is shoddy.



Show us what you have got then... apart from a terrible bedside manner ; )

So far from reading your posts it seems that far from being an expert, you seem to be quick to jump to conclusions , which show that you do not even read English properly, let alone code, and you are behaving in a way that is a little bit childish...  I note there are obviously some real experts that have been providing valuable and thoughtful/well though out intelligent feedback, what you are doing is some sort of constant bickering attack.  There is nothing wrong with being nice, thoughtful, and treating people and their work with some respect, and frankly even if your motives are good, which I question, then if you are trying to help people, then be a nice guy about it!  you may have more joy in actually helping people, because to help people you need to communicate wth people to get them to listen, not attack,  and at the end of the day if you are not helping, then you are just in the way, and if you are helping then how about a dose of humility and common decency along with that good deed?  You know, try not to be a jerk about it,  otherwise it is not avery attractive way to carry on, and will get you nothing in life. Just think about it.

Back on topic.  

Simon Cowell of American Idol sounded like a complete jerk from his criticism.  but their were honest and spot on.

I'm telling you how it is,  this stuff is shoddy work.  I'm not the only one saying this.  Just saying it like it is.

If you expect me to sound nice on code that is supposed to secure someone's money,  then you aren't going to hear that from me.  This is a serious business and if you can't take the heat, get out of the business.

 
                                . ██████████.
                              .████████████████.
                           .██████████████████████.
                        -█████████████████████████████
                     .██████████████████████████████████.
                  -█████████████████████████████████████████
               -███████████████████████████████████████████████
           .-█████████████████████████████████████████████████████.
        .████████████████████████████████████████████████████████████
       .██████████████████████████████████████████████████████████████.
       .██████████████████████████████████████████████████████████████.
       ..████████████████████████████████████████████████████████████..
       .   .██████████████████████████████████████████████████████.
       .      .████████████████████████████████████████████████.

       .       .██████████████████████████████████████████████
       .    ██████████████████████████████████████████████████████
       .█████████████████████████████████████████████████████████████.
        .███████████████████████████████████████████████████████████
           .█████████████████████████████████████████████████████
              .████████████████████████████████████████████████
                   ████████████████████████████████████████
                      ██████████████████████████████████
                          ██████████████████████████
                             ████████████████████
                               ████████████████
                                   █████████
.CryptoTalk.org.|.MAKE POSTS AND EARN BTC!.🏆
klee
Legendary
*
Offline Offline

Activity: 1498
Merit: 1000



View Profile
January 05, 2014, 06:31:53 PM
 #111

Hey Freak did you finally find a bf here? You damn attention whore Wink
salsacz
Hero Member
*****
Offline Offline

Activity: 490
Merit: 504


View Profile
January 05, 2014, 06:47:17 PM
 #112

hello experts,
I am gathering your citations about the code and about BCNext, for videos and video documents... I would like to ask you if you can write about the ideas implemented in the code, if it is innovative and maybe - how smart is BCNext? Can we compare him with any scientist/inventor? It can be only 1-2 sentences...

I've got:

xibeijan

Quote
NXT's beauty is in the algorithms and maths that have brought forward the state-of-the-art.  I seriously doubt the creator cares about keeping tidy with the code.  In fact, I know quite a few genius computer scientists who produce really ugly, stupid code.  However, that doesn't matter one iota when the algorithms are groundbreakingly better than anything that's come before.

Our investment is in the extremely clever people behind the NXT project.  Computer science and software engineering, though related, are different things.  I am glad the NXT has a computer scientist like BCNext behind it who actually has new ideas and can bring them to life, no matter how messy the code may be.  New capabilities are something that has been missing from every other alt coin that has come before NXT.

As I said, some really great computer scientists do not follow great software engineering principles, but their code does things no one else's can.  And that, my friend, is the point.

Bcnext is a freaking genius. I worked so hard to try to figure something out like this myself to no avail. What i proposed in my thread is a far cry from this much better solution.

That we are not investing in source code, we are investing in the algorithms, the big ideas (BCNext) and the huge community supporting NXT.

Computer science and software engineering, though related, are different things.  I am glad the NXT has a computer scientist like BCNext behind it who actually has new ideas and can bring them to life, no matter how messy the code may be.  New capabilities are something that has been missing from every other alt coin that has come before NXT.


rlh
Quote
I know that this is about fees and not generating currency, but the concept of adjusting system metrics, based off daily transactional statistics is something I've looked at and thought about for a loooooong time.  I think we could do the same type of thing here.

tk808
Quote
This is the real-world dude, not an algorithm found in a textbook

You can post it here or as PM, thank you!!
FrictionlessCoin
Legendary
*
Offline Offline

Activity: 868
Merit: 1000


Cryptotalk.org - Get paid for every post!


View Profile
January 05, 2014, 07:04:28 PM
 #113

because it fit's into this thread just on thing which has attract my attention.

i have to admit that i am not a native java coder and i just have had a quick look at
the api part due to the client dev, therefore this could be nonsens but for me, the code
structure seems that the creator intentionally veiled his native codingstyle.

if so, i bet the flaws couldn't be found by hunting partial code strucs but more within the
logical flow in general. moreover, if this is correct, the energy needed to change a perhaps
long used coding style this way must be immense. at least there is no chance to get any
usefull code correlation this way.

as said, it could be totally wrong but i have seen many lines of code in different
languages, this structure doesn't seems coincidental for me.

perhaps a fluent java coder could have a quick overview again, with this in mind.

Very possible. The whole application running as a servlet in Jetty web server, it needs to interact w/ the servlet container.

It's not a good practice for applications taking control of threads directly,  and that destroy() method looks disturbing.
 

Not only that,  did you realize that the wallet is also exposed to the public internet?   That there is not mechanism to prevent a brute force password attack?   

In theory, it is not good practice to spawn of thread inside a servlet container.





 
                                . ██████████.
                              .████████████████.
                           .██████████████████████.
                        -█████████████████████████████
                     .██████████████████████████████████.
                  -█████████████████████████████████████████
               -███████████████████████████████████████████████
           .-█████████████████████████████████████████████████████.
        .████████████████████████████████████████████████████████████
       .██████████████████████████████████████████████████████████████.
       .██████████████████████████████████████████████████████████████.
       ..████████████████████████████████████████████████████████████..
       .   .██████████████████████████████████████████████████████.
       .      .████████████████████████████████████████████████.

       .       .██████████████████████████████████████████████
       .    ██████████████████████████████████████████████████████
       .█████████████████████████████████████████████████████████████.
        .███████████████████████████████████████████████████████████
           .█████████████████████████████████████████████████████
              .████████████████████████████████████████████████
                   ████████████████████████████████████████
                      ██████████████████████████████████
                          ██████████████████████████
                             ████████████████████
                               ████████████████
                                   █████████
.CryptoTalk.org.|.MAKE POSTS AND EARN BTC!.🏆
FrictionlessCoin
Legendary
*
Offline Offline

Activity: 868
Merit: 1000


Cryptotalk.org - Get paid for every post!


View Profile
January 05, 2014, 07:07:56 PM
 #114

You know why I hang out in the Nxt threads?

You write some garbage and you get honest answers from CfB. You are trolling around to learn a few tricks from CfB. This is just dishonorable.

I have the impression you don't want to be friendly and nice, FrictionlessCoin. Please, just go. Thank you.

If you are an expert in a field and you see an amateur do very shoddy work, the I think one would have the responsibility of pointing this out.

The work here is plain and simple shoddy.

Maybe the ideas may make sense (don't know,  I have not seen the spec),  but the work is shoddy.



Show us what you have got then... apart from a terrible bedside manner ; )


bitcoin-ng.boards.net   join the development!

 
                                . ██████████.
                              .████████████████.
                           .██████████████████████.
                        -█████████████████████████████
                     .██████████████████████████████████.
                  -█████████████████████████████████████████
               -███████████████████████████████████████████████
           .-█████████████████████████████████████████████████████.
        .████████████████████████████████████████████████████████████
       .██████████████████████████████████████████████████████████████.
       .██████████████████████████████████████████████████████████████.
       ..████████████████████████████████████████████████████████████..
       .   .██████████████████████████████████████████████████████.
       .      .████████████████████████████████████████████████.

       .       .██████████████████████████████████████████████
       .    ██████████████████████████████████████████████████████
       .█████████████████████████████████████████████████████████████.
        .███████████████████████████████████████████████████████████
           .█████████████████████████████████████████████████████
              .████████████████████████████████████████████████
                   ████████████████████████████████████████
                      ██████████████████████████████████
                          ██████████████████████████
                             ████████████████████
                               ████████████████
                                   █████████
.CryptoTalk.org.|.MAKE POSTS AND EARN BTC!.🏆
jl777
Legendary
*
Offline Offline

Activity: 1176
Merit: 1132


View Profile WWW
January 05, 2014, 07:17:55 PM
 #115

because it fit's into this thread just on thing which has attract my attention.

i have to admit that i am not a native java coder and i just have had a quick look at
the api part due to the client dev, therefore this could be nonsens but for me, the code
structure seems that the creator intentionally veiled his native codingstyle.

if so, i bet the flaws couldn't be found by hunting partial code strucs but more within the
logical flow in general. moreover, if this is correct, the energy needed to change a perhaps
long used coding style this way must be immense. at least there is no chance to get any
usefull code correlation this way.

as said, it could be totally wrong but i have seen many lines of code in different
languages, this structure doesn't seems coincidental for me.

perhaps a fluent java coder could have a quick overview again, with this in mind.

Very possible. The whole application running as a servlet in Jetty web server, it needs to interact w/ the servlet container.

It's not a good practice for applications taking control of threads directly,  and that destroy() method looks disturbing.
 

Not only that,  did you realize that the wallet is also exposed to the public internet?   That there is not mechanism to prevent a brute force password attack?   

In theory, it is not good practice to spawn of thread inside a servlet container.






Gee, would it really freak you out if you found out you can do an OFFLINE brute force attack?
Just need to scan 64 bits and pick up all the darkNXT and 256 bits to crack everybody's acct. But hurry, you only have until shortly after API 2.0, cuz there will be a second 256 bit key on all the big accts, plus wallet fragmentation.

Pretty amateurish, isn't it, us taking security to 256 bits twice. Some criticize it is overkill on security. At least you can keep complaining without coming up with ANY actual flaws in the code, even trivial off by one errors. School kids usually write so many such errors, strange we haven't found a single one.

James

http://www.digitalcatallaxy.com/report2015.html
100+ page annual report for SuperNET
jl777
Legendary
*
Offline Offline

Activity: 1176
Merit: 1132


View Profile WWW
January 05, 2014, 07:22:26 PM
 #116

hello experts,
I am gathering your citations about the code and about BCNext, for videos and video documents... I would like to ask you if you can write about the ideas implemented in the code, if it is innovative and maybe - how smart is BCNext? Can we compare him with any scientist/inventor? It can be only 1-2 sentences...

I've got:

xibeijan

Quote
NXT's beauty is in the algorithms and maths that have brought forward the state-of-the-art.  I seriously doubt the creator cares about keeping tidy with the code.  In fact, I know quite a few genius computer scientists who produce really ugly, stupid code.  However, that doesn't matter one iota when the algorithms are groundbreakingly better than anything that's come before.

Our investment is in the extremely clever people behind the NXT project.  Computer science and software engineering, though related, are different things.  I am glad the NXT has a computer scientist like BCNext behind it who actually has new ideas and can bring them to life, no matter how messy the code may be.  New capabilities are something that has been missing from every other alt coin that has come before NXT.

As I said, some really great computer scientists do not follow great software engineering principles, but their code does things no one else's can.  And that, my friend, is the point.

Bcnext is a freaking genius. I worked so hard to try to figure something out like this myself to no avail. What i proposed in my thread is a far cry from this much better solution.

That we are not investing in source code, we are investing in the algorithms, the big ideas (BCNext) and the huge community supporting NXT.

Computer science and software engineering, though related, are different things.  I am glad the NXT has a computer scientist like BCNext behind it who actually has new ideas and can bring them to life, no matter how messy the code may be.  New capabilities are something that has been missing from every other alt coin that has come before NXT.


rlh
Quote
I know that this is about fees and not generating currency, but the concept of adjusting system metrics, based off daily transactional statistics is something I've looked at and thought about for a loooooong time.  I think we could do the same type of thing here.

tk808
Quote
This is the real-world dude, not an algorithm found in a textbook

You can post it here or as PM, thank you!!

BCnext is the Tesla (the man, not car) of crypto currency. With simple control flow, he has created the NXT network in about 4000 lines of code. Like Tesla's designs that few people understand, the magic constants used, happen to just work. BCnext has utilized the numerical properties of numbers themselves to create a peer to peer crypto with pretty much all the features any other crypto has conceived, in ~4000 lines of java that runs on cellphones!

James

http://www.digitalcatallaxy.com/report2015.html
100+ page annual report for SuperNET
Jaguar0625
Sr. Member
****
Offline Offline

Activity: 299
Merit: 250


View Profile
January 05, 2014, 08:16:03 PM
 #117

Since setBalance can throw, where you do the following, balance and unconfirmed balance can get out of sync:

Code:
generatorAccount.setBalance(generatorAccount.balance + totalFee * 100L);
generatorAccount.setUnconfirmedBalance(generatorAccount.unconfirmedBalance + totalFee * 100L);

Code:
void setBalance(long balance) throws Exception {
    this.balance = balance;
    for (Peer peer : peers.values()) {
    if (peer.accountId == id && peer.adjustedWeight > 0) {
        peer.updateWeight();
    }
}

Granted, this is unlikely since you are suppressing all exceptions around the network calls. But it might be more robust to calculate balance from unconfirmedbalance or vice-versa.

NEM - nem.io
Come-from-Beyond
Legendary
*
Offline Offline

Activity: 2142
Merit: 1009

Newbie


View Profile
January 05, 2014, 08:17:13 PM
 #118

Since setBalance can throw, where you do the following, balance and unconfirmed balance can get out of sync:

Code:
generatorAccount.setBalance(generatorAccount.balance + totalFee * 100L);
generatorAccount.setUnconfirmedBalance(generatorAccount.unconfirmedBalance + totalFee * 100L);

Code:
void setBalance(long balance) throws Exception {
    this.balance = balance;
    for (Peer peer : peers.values()) {
    if (peer.accountId == id && peer.adjustedWeight > 0) {
        peer.updateWeight();
    }
}

Granted, this is unlikely since you are suppressing all exceptions around the network calls. But it might be more robust to calculate balance from unconfirmedbalance or vice-versa.

Jean-Luc was going to fix this issue AFAIK.
Jaguar0625
Sr. Member
****
Offline Offline

Activity: 299
Merit: 250


View Profile
January 05, 2014, 08:28:52 PM
 #119

There does seem to be a lot of excessive locking. For example:
Code:
Transaction transaction = Transaction.getTransaction(buffer);
synchronized (Nxt.transactions) {
    transaction.index = ++transactionCounter;
}

Since all you are really doing is setting a transaction number, you should be using AtomicInteger. This would eliminate the lock completely

But, in general, you should consider minimizing the scopes of your locks. For example, here, you're locking the entire transactions array to update a single transaction. It would be better to lock around that specific transaction so as not to block other pieces of code attempting to inspect / edit other transactions.

Also, there are a number of places where reader-writer locks are more appropriate than using synchronized (e.g. when dealing users, which should change relatively infrequently).

This extra locking can help scalability down the road.

NEM - nem.io
FrictionlessCoin
Legendary
*
Offline Offline

Activity: 868
Merit: 1000


Cryptotalk.org - Get paid for every post!


View Profile
January 05, 2014, 08:37:54 PM
Last edit: January 05, 2014, 09:07:24 PM by FrictionlessCoin
 #120

There does seem to be a lot of excessive locking. For example:
Code:
Transaction transaction = Transaction.getTransaction(buffer);
synchronized (Nxt.transactions) {
    transaction.index = ++transactionCounter;
}

Since all you are really doing is setting a transaction number, you should be using AtomicInteger. This would eliminate the lock completely

But, in general, you should consider minimizing the scopes of your locks. For example, here, you're locking the entire transactions array to update a single transaction. It would be better to lock around that specific transaction so as not to block other pieces of code attempting to inspect / edit other transactions.

Also, there are a number of places where reader-writer locks are more appropriate than using synchronized (e.g. when dealing users, which should change relatively infrequently).

This extra locking can help scalability down the road.

Yeah,  let's just throw as many synchronized blocks all over the place because we really don't know what we're doing.

I would have been impressed if the code didn't use a single synchronized block.  That would be an indication of a very well designed system.

Sigh.

 
                                . ██████████.
                              .████████████████.
                           .██████████████████████.
                        -█████████████████████████████
                     .██████████████████████████████████.
                  -█████████████████████████████████████████
               -███████████████████████████████████████████████
           .-█████████████████████████████████████████████████████.
        .████████████████████████████████████████████████████████████
       .██████████████████████████████████████████████████████████████.
       .██████████████████████████████████████████████████████████████.
       ..████████████████████████████████████████████████████████████..
       .   .██████████████████████████████████████████████████████.
       .      .████████████████████████████████████████████████.

       .       .██████████████████████████████████████████████
       .    ██████████████████████████████████████████████████████
       .█████████████████████████████████████████████████████████████.
        .███████████████████████████████████████████████████████████
           .█████████████████████████████████████████████████████
              .████████████████████████████████████████████████
                   ████████████████████████████████████████
                      ██████████████████████████████████
                          ██████████████████████████
                             ████████████████████
                               ████████████████
                                   █████████
.CryptoTalk.org.|.MAKE POSTS AND EARN BTC!.🏆
Pages: « 1 2 3 4 5 [6] 7 8 9 10 »  All
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!