#!/usr/bin/perl
use warnings;
use strict;
use 5.014;
# Uncomment this to lock down the miner entirely
# print "Miner currently upgrading - BACK SOON";
# exit 1;
# A list of wallets you do not want to deal with
# For example this enty will prevent a shady ribasushi
# character from storing things on your miner
my $denylist = { map {( $_ => 1 )} qw(
f3qpseg3qlpckug75qqas6jsce4up6kg5bo4yaefwnxo4fwx2n5f7jpkkrzy37jxnshkd6mazxso2rxfoax111
)};
use JSON::PP 'decode_json';
my $deal = eval { decode_json(do{ local $/; <> }) };
if( ! defined $deal ) {
print "Deal proposal JSON parsing failed: $@";
exit 1;
}
if( $denylist->{$deal->{Proposal}{Client}} ) {
print "Deals from client wallet $deal->{Proposal}{Client} are not welcome";
exit 1;
}
exit 0;