SVC 보팅 관련 반환 로직 추가

안녕하세요 @realmankwon입니다.

SVC 토큰을 통한 @stablewon 계정의 보팅이 요즘 계속 에러가 발생하고 있습니다.
에러의 원인은 다음과 같습니다.

  • 예상치 못했던 예외 건 발생(포스팅 주소 오류)
  • 반환 건을 처리한 이후 보팅할 것이 없으면 Read Date 를 갱신하지 않아 반환 건을 다시 처리하게 되어 오류 발생
  • 이미 보팅 된 건에 대해 처리할 경우
  • 디버깅시에 기존에 처리한 건에 대해서 반환하게 되는 오류

디비 방식으로 하고 있지 않다보니 명확하게 처리된 여부를 확인하기가 어려웠습니다.
위의 오류 건을 처리하기 위해 전송 내역을 저장하는 디비에 SVC 전송 건의 timestamp 를 입력하도록 하여 보팅 후 Burn 건과 오류 시 Return 건을 Unique 하게 비교할 수 있도록 처리하였습니다.

로직은 다음과 같이 변경하였습니다.

image.png

  1. Memo 가 Null 일 경우
    • 반환없이 해당 건의 timestamp 입력으로 처리 완료
  2. Permlink 가 오류 일 경우
    • 이미 Return 처리하였으면 해당 건의 timestamp 입력으로 처리 완료
    • Return 처리하지 않았으면 Return 처리 후 해당 건의 timestamp 입력으로 처리 완료
  3. Voting 확인
    • Voting 이 되어 있고 동일 Permlink의 timestamp 와 일치하면 해당 건의 timestamp 입력으로 처리 완료
    • Voting 이 되어 있고 동일 Permlink의 timestamp 와 일치하지 않으면 Return 처리 여부 확인
    • 이후 로직은 2.번의 Return 건과 동일 로직
  4. Voting 처리
    • Voting 후에 SVC Burn 처리
    • ^^ 으로 Reply 처리

저도 하면서 헷갈려서 Flowchart를 그려서 처리를 하였습니다.
SVC 보팅 건에 대해 오류가 발생하면 디버그/제안에 글을 남겨주시기 바랍니다.
감사합니다.

Sort:  

But the end of all things has drawn near. Therefore be sober-minded and be sober unto prayers.(1 Peter 4:7)

Question from the Bible, Is there such a thing as untimely death in the Bible?

Watch the Video below to know the Answer...
(Sorry for sending this comment. We are not looking for our self profit, our intentions is to preach the words of God in any means possible.)


Comment what you understand of our Youtube Video to receive our full votes. We have 30,000 #SteemPower. It's our little way to Thank you, our beloved friend.
Check our Discord Chat
Join our Official Community: https://steemit.com/created/hive-182074

Coin Marketplace

STEEM 0.18
TRX 0.16
JST 0.031
BTC 63062.73
ETH 2687.13
USDT 1.00
SBD 2.54