-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f1a5109
commit 253b3e8
Showing
3 changed files
with
153 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#!/usr/bin/env python3 | ||
"""A plugin which returns any attempt without candidate spend transaction as needing to be revaulted""" | ||
|
||
import json | ||
import sys | ||
|
||
|
||
def read_request(): | ||
"""Read a JSON request from stdin up to the '\n' delimiter.""" | ||
buf = "" | ||
while len(buf) == 0 or buf[-1] != "\n": | ||
buf += sys.stdin.read() | ||
return json.loads(buf) | ||
|
||
|
||
if __name__ == "__main__": | ||
req = read_request() | ||
block_info = req["block_info"] | ||
|
||
vaults_without_spend_outpoints = [] | ||
for vault in block_info["new_attempts"]: | ||
if vault["candidate_tx"] is None: | ||
vaults_without_spend_outpoints.append(vault["deposit_outpoint"]) | ||
|
||
resp = {"revault": vaults_without_spend_outpoints} | ||
sys.stdout.write(json.dumps(resp)) | ||
sys.stdout.flush() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters