Skip to content

Commit

Permalink
bugfix sendAllTransacttion in "peer_service_with_json" / and write lo…
Browse files Browse the repository at this point in the history
…gger::debug
  • Loading branch information
satellitex authored and l4l committed Mar 17, 2017
1 parent c141a09 commit 1ab215a
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 7 deletions.
3 changes: 2 additions & 1 deletion circle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ test:
--name iroha2 \
-v $IROHA_HOME/config/sumeragi2.json:/usr/local/iroha/config/sumeragi.json \
hyperledger/iroha-docker
- sudo lxc-attach -n "$(docker inspect --format '{{.Id}}' iroha1)" -- /bin/sh -c '/usr/local/iroha/bin/issue_transaction add peer 172.18.0.3 yUAFTYNh6qkhBMiNgNdg45Wk/XHOGYanuIroY9skfPQ= 1.0 true'
# docker exec -it iroha1 sh -c '/usr/local/iroha/bin/issue_transaction add peer yUAFTYNh6qkhBMiNgNdg45Wk/XHOGYanuIroY9skfPQ= 172.20.0.3 1.0 true'
- sudo lxc-attach -n "$(docker inspect --format '{{.Id}}' iroha1)" -- /bin/sh -c '/usr/local/iroha/bin/issue_transaction add peer yUAFTYNh6qkhBMiNgNdg45Wk/XHOGYanuIroY9skfPQ= 172.20.0.3 1.0 true'

post:
# iroha1 logs
Expand Down
4 changes: 2 additions & 2 deletions config/sumeragi1.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"group": [
{
"ip": "127.0.0.2",
"ip": "172.20.0.2",
"name": "iroha1",
"publicKey": "u7X/zQ/Dq21WW7YH4rbkpiCYJXjPxk5t3qNDKiVwBx8="
}
],
"me": {
"ip": "127.0.0.2",
"ip": "172.20.0.2",
"name": "iroha1",
"privateKey": "cPY84e0BXGUHBjT4QdlPI0LI3BPIfUfSZjB8jdWURkNQ+pEagT/ysrewbt2YUo/Qbfd5vczW5oDooGSNUBTj9g==",
"publicKey": "u7X/zQ/Dq21WW7YH4rbkpiCYJXjPxk5t3qNDKiVwBx8="
Expand Down
4 changes: 2 additions & 2 deletions config/sumeragi2.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"me": {
"ip": "172.18.0.3",
"ip": "172.20.0.3",
"name": "iroha2",
"privateKey": "SGjvIKNb9sh3H48/Lnid/slxt0H479kpDhZJu/xSfU8sX26lztYqFZTB8pSWL4eLLpx2nDqNr9n44sYkIRYzNQ==",
"publicKey": "yUAFTYNh6qkhBMiNgNdg45Wk/XHOGYanuIroY9skfPQ="},
"group": [
{
"ip": "172.18.0.3",
"ip": "172.20.0.3",
"name": "iroha2",
"publicKey": "yUAFTYNh6qkhBMiNgNdg45Wk/XHOGYanuIroY9skfPQ="
}
Expand Down
4 changes: 2 additions & 2 deletions core/infra/config/peer_service_with_json.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -342,9 +342,9 @@ bool PeerServiceConfig::sendAllTransactionToNewPeer( const peer::Node& peer ) {
logger::debug("peer-service") << "send all peer infomation";
auto sorted_peerList = getPeerList();
auto txResponse = Api::TransactionResponse();
txResponse.set_message( "Initilize send now Active PeerList info" );
txResponse.set_code( code++ );
for (auto &&peer : sorted_peerList) {
txResponse.set_message( "Initilize send now Active PeerList info" );
txResponse.set_code( code++ );
auto txPeer = TransactionBuilder<Add<Peer>>()
.setSenderPublicKey(getMyPublicKey())
.setPeer(txbuilder::createPeer(peer->getPublicKey(), peer->getIP(),
Expand Down
1 change: 1 addition & 0 deletions core/service/izanami.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ namespace izanami {
for (auto counter : hash_counter ) {
res = std::max(res, counter.second);
}
logger::debug("izanami") << "isFinishedReveive : res : " + std::to_string( res ) + " >= " + std::to_string(2 * config::PeerServiceConfig::getInstance().getMaxFaulty() + 1);
if( res >= 2 * config::PeerServiceConfig::getInstance().getMaxFaulty() + 1 ) return true;
return false;
}
Expand Down

0 comments on commit 1ab215a

Please sign in to comment.