Skip to content

Commit

Permalink
fix typo in internal handler
Browse files Browse the repository at this point in the history
  • Loading branch information
zack-bitcoin committed Jan 10, 2017
1 parent cf4bcef commit 16ae2b7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/networking/internal_handler.erl
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ handle(Req, State) ->
init(_Type, Req, _Opts) -> {ok, Req, no_state}.
terminate(_Reason, _Req, _State) -> ok.
-define(POP, <<1,6,3,87,3,5>>).
doit({sign, Tx}) -> {ok, keys:sign(Tx)};
doit({sign, Tx}) ->
{Accounts, _,_,_} = tx_pool:data(),
{ok, keys:sign(Tx, Accounts)};


doit({balance}) ->
Expand Down Expand Up @@ -118,7 +120,7 @@ doit({new_channel, IP, Port, CID, Bal1, Bal2, Rent, Fee}) ->
Entropy = channel_feeder:entropy(CID, [Acc1, Acc2]) + 1,
{Accounts, _,_,_} = tx_pool:data(),
Tx = new_channel_tx:make(CID, Accounts, Acc1, Acc2, Bal1, Bal2, Rent, Entropy, Fee),
STx = keys:sign(Tx),
STx = keys:sign(Tx, Accounts),
Msg = {new_channel, STx},
{ok, Ch} = talker:talk(Msg, IP, Port),
tx_pool_feeder:absorb(Ch),
Expand Down Expand Up @@ -155,7 +157,7 @@ doit({make_channel, IP, Port, MyBal, OtherBal, Rent, Fee, CID}) ->
ID = keys:id(),
Entropy = channel_feeder:entropy(CID, [ID, Acc2]) + 1,
Tx = new_channel_tx:make(CID, Accounts, keys:id(), Acc2, MyBal, OtherBal, Rent, Entropy, Fee),
{ok, _} = talker:talk({make_channel, keys:sign(Tx)}, IP, Port);
{ok, _} = talker:talk({make_channel, keys:sign(Tx, Accounts)}, IP, Port);

doit(X) ->
io:fwrite("don't know how to handle it \n"),
Expand Down
1 change: 1 addition & 0 deletions start.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#if you want to use a different port, then start like this:
# sh start 3666


#sh clean.sh #this deletes the database so every time we re-start, we have 0 blocks again. only needed during testing.
./rebar get-deps
#sh clean.sh #this deletes the database so every time we re-start, we have 0 blocks again. only needed during testing.
Expand Down

0 comments on commit 16ae2b7

Please sign in to comment.