Skip to content

Commit

Permalink
added print stament
Browse files Browse the repository at this point in the history
  • Loading branch information
zack-bitcoin committed Feb 8, 2017
1 parent 96f15ef commit 6079f3b
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 12 deletions.
20 changes: 10 additions & 10 deletions channel_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,22 @@
curl -i -d '["add_peer", [127,0,0,1], 3010]' http://localhost:3021
curl -i -d '["add_peer", [127,0,0,1], 3020]' http://localhost:3011

curl -i -d '["mine_block", 1, 1000000]' http://localhost:3011
curl -i -d '["mine_block", 1, 1000000]' http://localhost:3011
sleep 1
curl -i -d '["sync", [127,0,0,1], 3020]' http://localhost:3011
sleep 1
curl -i -d '["mine_block", 1, 1000000]' http://localhost:3021
#curl -i -d '["mine_block", 1, 1000000]' http://localhost:3011
#curl -i -d '["mine_block", 1, 1000000]' http://localhost:3011
#sleep 1
#curl -i -d '["sync", [127,0,0,1], 3020]' http://localhost:3011
#sleep 1
#curl -i -d '["mine_block", 1, 1000000]' http://localhost:3021
sleep 1
curl -i -d '["sync", [127,0,0,1], 3020]' http://localhost:3011
sleep 1

curl -i -d '["new_channel", [127,0,0,1], 3020, 1, 10000, 4000, 0, 4]' http://localhost:3011
sleep 1
curl -i -d '["sync", [127,0,0,1], 3020]' http://localhost:3011
sleep 1
curl -i -d '["mine_block", 1, 1000000]' http://localhost:3011
sleep 1
#curl -i -d '["sync", [127,0,0,1], 3020]' http://localhost:3011
#sleep 1
#curl -i -d '["mine_block", 1, 1000000]' http://localhost:3011
#sleep 1
curl -i -d '["sync", [127,0,0,1], 3020]' http://localhost:3011
sleep 1
curl -i -d '["channel_spend", [127,0,0,1], 3020, 27]' http://localhost:3011
Expand Down
4 changes: 2 additions & 2 deletions src/channels/channel_feeder.erl
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,8 @@ handle_call({agree_bet, Name, SSPK, Vars, Secret}, _From, X) ->
Return = make_bet_internal(Other, Name, Vars, Secret),
update_to_me_internal(Return, SSPK),
{reply, Return, X};
handle_call({make_simplification, Other, Name, OtherSecret}, _From, X) ->
Z = make_simplification_internal(Other, Name, OtherSecret),
handle_call({make_simplification, Other, Name, OtherSS}, _From, X) ->
Z = make_simplification_internal(Other, Name, OtherSS),
{reply, Z, X};
handle_call({agree_simplification, Name, SSPK, OtherSS}, _From, X) ->
{Accounts, _,_,_} = tx_pool:data(),
Expand Down
2 changes: 2 additions & 0 deletions src/networking/handler.erl
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@ doit({dice, 1, Other, Commit, Amount}) ->
{ok, SSPK, MyCommit};
doit({dice, 2, ID, SSPK, SS}) ->
channel_feeder:update_to_me(SSPK),
io:fwrite("handler dice 2 "),
disassembler:doit(SS),
{SSPKsimple, MySecret} = channel_feeder:make_simplification(ID, dice, SS),
{ok, SSPKsimple, MySecret};
doit({dice, 3, _ID, SSPK}) ->
Expand Down

0 comments on commit 6079f3b

Please sign in to comment.