Skip to content

Commit

Permalink
Fixes issue with offset timestamps
Browse files Browse the repository at this point in the history
  • Loading branch information
Ashy5000 committed Mar 16, 2024
1 parent 34a8e4a commit 97c0d06
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion blockchain.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[{"sender":{"P":124334585104178018537342354507973396229081486761522638665531587228378821572146308508040265181448362979380041028812468562654458638087008520917706538759743858057739798219334114639642712323100006159568840572201452789112766967306545744051923877499403078217652976253866837175759751485975307908215307693172716083951,"Q":1325683629013751074584942400294182844511772252959,"G":26141189716406718735166685954688468302446411755761057594764426589010889617733449918677660549354929129990052410279264115900911908928290282365235099116814778923262737065487773320997659370640354573996110246242658866145422245611500205259643638514924156846224797192485592075928422150636297085091237112406248487655,"Y":111896023106432554777809308052085863034982465927166615553218927304801713083181810551956462303169716813833436449219419993350043269466866139597543167870732984366746098836377306502199983155278737536883971636034997486082415756904066748028920533259155461870402333867374806819743871633519713520336324574686122971428},"recipient":{"P":124334585104178018537342354507973396229081486761522638665531587228378821572146308508040265181448362979380041028812468562654458638087008520917706538759743858057739798219334114639642712323100006159568840572201452789112766967306545744051923877499403078217652976253866837175759751485975307908215307693172716083951,"Q":1325683629013751074584942400294182844511772252959,"G":26141189716406718735166685954688468302446411755761057594764426589010889617733449918677660549354929129990052410279264115900911908928290282365235099116814778923262737065487773320997659370640354573996110246242658866145422245611500205259643638514924156846224797192485592075928422150636297085091237112406248487655,"Y":123},"miner":{"P":168200871893033804870799634697462328944638433674704436661817787648633417925437204509339761693620849193268426903449070813327814689423746099093408374498357397459163210972375554728987561297091040219031504155199990603856392988701625639694879468087547312335911491057186512893098304324633020945086331849246867043357,"Q":1046670084638218396077199143251551363208506465433,"G":69047398695399525831031561001040812108714655194608942657210883880294137135420501106340297843261123670356989516418430722690789106439363484616426323979169215129999077346179350969565207439847971188781773312235420180319247278754552121253960951801593954552971243013906009254854302868272537872839739658369900959967,"Y":113593122885902890126821985757995540498761934354780946290216480898050693031336617247853256701540193881823377608209337819471139085473392314868277017349646409074676710198743237383827261388430299524926303183320949235512066755896303849119592387944547093387305771252856786451218527389780259332808873733118050319479},"amount":0,"nonce":120527,"R":958623384026095086840676931797634166445854856577,"S":1245707932003048845259346736849676005734710729859,"miningTime":4802251478,"difficulty":100000,"previousBlockHash":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}]
[{"sender":{"P":null,"Q":null,"G":null,"Y":null},"recipient":{"P":null,"Q":null,"G":null,"Y":null},"miner":{"P":null,"Q":null,"G":null,"Y":null},"amount":0,"nonce":0,"R":0,"S":0,"miningTime":0,"difficulty":0,"previousBlockHash":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"timestamp":"0001-01-01T00:00:00Z"},{"sender":{"P":124334585104178018537342354507973396229081486761522638665531587228378821572146308508040265181448362979380041028812468562654458638087008520917706538759743858057739798219334114639642712323100006159568840572201452789112766967306545744051923877499403078217652976253866837175759751485975307908215307693172716083951,"Q":1325683629013751074584942400294182844511772252959,"G":26141189716406718735166685954688468302446411755761057594764426589010889617733449918677660549354929129990052410279264115900911908928290282365235099116814778923262737065487773320997659370640354573996110246242658866145422245611500205259643638514924156846224797192485592075928422150636297085091237112406248487655,"Y":111896023106432554777809308052085863034982465927166615553218927304801713083181810551956462303169716813833436449219419993350043269466866139597543167870732984366746098836377306502199983155278737536883971636034997486082415756904066748028920533259155461870402333867374806819743871633519713520336324574686122971428},"recipient":{"P":124334585104178018537342354507973396229081486761522638665531587228378821572146308508040265181448362979380041028812468562654458638087008520917706538759743858057739798219334114639642712323100006159568840572201452789112766967306545744051923877499403078217652976253866837175759751485975307908215307693172716083951,"Q":1325683629013751074584942400294182844511772252959,"G":26141189716406718735166685954688468302446411755761057594764426589010889617733449918677660549354929129990052410279264115900911908928290282365235099116814778923262737065487773320997659370640354573996110246242658866145422245611500205259643638514924156846224797192485592075928422150636297085091237112406248487655,"Y":123},"miner":{"P":168200871893033804870799634697462328944638433674704436661817787648633417925437204509339761693620849193268426903449070813327814689423746099093408374498357397459163210972375554728987561297091040219031504155199990603856392988701625639694879468087547312335911491057186512893098304324633020945086331849246867043357,"Q":1046670084638218396077199143251551363208506465433,"G":69047398695399525831031561001040812108714655194608942657210883880294137135420501106340297843261123670356989516418430722690789106439363484616426323979169215129999077346179350969565207439847971188781773312235420180319247278754552121253960951801593954552971243013906009254854302868272537872839739658369900959967,"Y":113593122885902890126821985757995540498761934354780946290216480898050693031336617247853256701540193881823377608209337819471139085473392314868277017349646409074676710198743237383827261388430299524926303183320949235512066755896303849119592387944547093387305771252856786451218527389780259332808873733118050319479},"amount":0,"nonce":107205,"R":941144495764846559675675538749071345253657097734,"S":1045292061480776227279410969126303648902832058938,"miningTime":9304712711,"difficulty":100000,"previousBlockHash":[34,74,4,191,81,58,244,37,24,85,239,153,81,190,217,206,161,23,155,60,225,95,77,215,229,64,156,175,53,67,133,27],"timestamp":"2024-03-15T17:30:40.686168336-07:00"},{"sender":{"P":124334585104178018537342354507973396229081486761522638665531587228378821572146308508040265181448362979380041028812468562654458638087008520917706538759743858057739798219334114639642712323100006159568840572201452789112766967306545744051923877499403078217652976253866837175759751485975307908215307693172716083951,"Q":1325683629013751074584942400294182844511772252959,"G":26141189716406718735166685954688468302446411755761057594764426589010889617733449918677660549354929129990052410279264115900911908928290282365235099116814778923262737065487773320997659370640354573996110246242658866145422245611500205259643638514924156846224797192485592075928422150636297085091237112406248487655,"Y":111896023106432554777809308052085863034982465927166615553218927304801713083181810551956462303169716813833436449219419993350043269466866139597543167870732984366746098836377306502199983155278737536883971636034997486082415756904066748028920533259155461870402333867374806819743871633519713520336324574686122971428},"recipient":{"P":124334585104178018537342354507973396229081486761522638665531587228378821572146308508040265181448362979380041028812468562654458638087008520917706538759743858057739798219334114639642712323100006159568840572201452789112766967306545744051923877499403078217652976253866837175759751485975307908215307693172716083951,"Q":1325683629013751074584942400294182844511772252959,"G":26141189716406718735166685954688468302446411755761057594764426589010889617733449918677660549354929129990052410279264115900911908928290282365235099116814778923262737065487773320997659370640354573996110246242658866145422245611500205259643638514924156846224797192485592075928422150636297085091237112406248487655,"Y":123},"miner":{"P":168200871893033804870799634697462328944638433674704436661817787648633417925437204509339761693620849193268426903449070813327814689423746099093408374498357397459163210972375554728987561297091040219031504155199990603856392988701625639694879468087547312335911491057186512893098304324633020945086331849246867043357,"Q":1046670084638218396077199143251551363208506465433,"G":69047398695399525831031561001040812108714655194608942657210883880294137135420501106340297843261123670356989516418430722690789106439363484616426323979169215129999077346179350969565207439847971188781773312235420180319247278754552121253960951801593954552971243013906009254854302868272537872839739658369900959967,"Y":113593122885902890126821985757995540498761934354780946290216480898050693031336617247853256701540193881823377608209337819471139085473392314868277017349646409074676710198743237383827261388430299524926303183320949235512066755896303849119592387944547093387305771252856786451218527389780259332808873733118050319479},"amount":0,"nonce":81758,"R":941144495764846559675675538749071345253657097734,"S":1045292061480776227279410969126303648902832058938,"miningTime":9875618426,"difficulty":100000,"previousBlockHash":[0,0,60,12,123,166,127,35,63,17,177,255,142,159,135,148,112,69,164,81,154,149,171,144,191,239,108,164,167,72,31,158],"timestamp":"2024-03-15T17:30:40.686217108-07:00"}]
3 changes: 2 additions & 1 deletion blockutil.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,9 @@ func Send(receiver string, amount string) {
}
rStr := r.String()
sStr := s.String()
timestamp := time.Now().UnixNano()
for _, peer := range GetPeers() {
body := strings.NewReader(fmt.Sprintf("%s%s:%s%s:%s:%s:%s:%d", sender, parametersString, receiver, parametersString, amount, rStr, sStr, time.Now().UnixNano()))
body := strings.NewReader(fmt.Sprintf("%s%s:%s%s:%s:%s:%s:%d", sender, parametersString, receiver, parametersString, amount, rStr, sStr, timestamp))
req, err := http.NewRequest(http.MethodGet, peer+"/mine", body)
if err != nil {
panic(err)
Expand Down

0 comments on commit 97c0d06

Please sign in to comment.